Child: [a01f59] (diff)

Download this file

test_controllers.py    35 lines (25 with data), 868 Bytes

 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
import os
import pkg_resources
from pylons import c
from ming.orm import ThreadLocalORMSession
from pyforge.lib import helpers as h
from forgegit.tests import TestController
class TestRootController(TestController):
def setUp(self):
TestController.setUp(self)
h.set_context('test', 'src_git')
repo_dir = pkg_resources.resource_filename(
'forgegit', 'tests/data')
c.app.repo.fs_path = repo_dir
c.app.repo.status = 'ready'
c.app.repo.name = 'testgit.git'
ThreadLocalORMSession.flush_all()
ThreadLocalORMSession.close_all()
def test_index(self):
resp = self.app.get('/src/')
assert 'git clone' in resp
assert 'ready' in resp
assert 'Revision 1' in resp
def test_commit(self):
resp = self.app.get('/src/1/')
assert '+' in resp