Parent: [6c2607] (diff)

Child: [f4f159] (diff)

Download this file

test_command.py    35 lines (28 with data), 1.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
import os
from unittest import TestCase
from pylons import c, g
import ming
from pyforge import model as M
from pyforge.lib import app_globals
from forgescm.lib import hg, git
from forgescm import model as FM
ming.configure(**{'ming.main.master':'mongo://localhost:27017/pyforge'})
class EmptyClass(object): pass
class TestCommand(TestCase):
def setUp(self):
g._push_object(app_globals.Globals())
c._push_object(EmptyClass())
c.project = M.Project.query.get(_id='projects/test/')
c.app = c.project.app_instance('src')
def test_init_log(self):
cmd = hg.init()
assert os.getcwd() != cmd.cwd()
cmd.clean_dir()
cmd.run()
git.init().run()
hg.scm_log('-g', '-p').run()
git.scm_log('-p').run(output_consumer=lambda line:None)
def test_setup_gitweb(self):
repo = c.app.repo
repo_name = c.project._id + c.app.config.options.mount_point
git.setup_gitweb(repo_name, repo.repo_dir)