Parent: [6c2607] (diff)

Child: [e589f3] (diff)

Download this file

test_controller.py    56 lines (45 with data), 1.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from urllib import urlencode
from tg import config
from nose.tools import assert_true
from forgescm.tests import TestController
from pyforge.model import Project
from forgescm.tests import test_helper
from pylons import c, g
import sys
class TestRootController(TestController):
def test_index(self):
test_helper.ensure_c_project_and_app()
response = self.app.get('/Repository/')
assert_true('Welcome to ForgeSCM' in response)
def test_fork(self):
test_helper.ensure_c_project_and_app()
project = c.project
assert project
response = self.app.get(
'/Repository/fork?',
urlencode(dict(project_id=project._id,
mount_point='fork1')))
assert_true(response.status_int == 302)
def test_search(self):
response = self.app.get(
'/Repository/search')
response = self.app.get(
'/Repository/search?',
urlencode(dict(q='as;ldjfa;lmseivals;evjalse',
history='false')))
assert_true('No results.' in response, response)
def test_reinit(self):
test_helper.ensure_c_project_and_app()
response = self.app.get('/Repository/reinit')
assert_true(response.status_int == 302)
def test_reclone(self):
test_helper.ensure_c_project_and_app()
response = self.app.get(
'/Repository/reclone')
assert_true(response.status_int == 302)
def test_clone_from(self):
url = config.here + '/forgescm/tests/hg_repo'
response = self.app.get(
'/Repository/clone_from?',
urlencode(dict(url=url)))
assert_true(response.status_int == 302)