Parent: [e589f3] (diff)

Download this file

test_controller.py    63 lines (50 with data), 2.0 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
56
57
58
59
60
61
62
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_gitweb(self):
test_helper.ensure_c_project_and_app()
assert c.app
response = self.app.get('/_wsgi_/scm/p/test/src_git/.git')
assert 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)