Parent: [a404b5] (diff)

Download this file

test_command.py    41 lines (32 with data), 1.1 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
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
from forgescm.tests import test_helper
from time import sleep
ming.configure(**{'ming.main.master':'mongo://localhost:27017/pyforge'})
class EmptyClass(object): pass
class TestCommand(TestCase):
def setUp(self):
test_helper.test_setup_app()
test_helper.ensure_c_project_and_app()
def test_init_hg_log(self):
cmd = hg.init()
assert os.getcwd() != cmd.cwd()
cmd.clean_dir()
cmd.run()
hg.scm_log('-g', '-p').run()
def test_init_git_log(self):
cmd = git.init()
assert os.getcwd() != cmd.cwd()
cmd.clean_dir()
cmd.run()
assert os.path.exists(os.path.join(cmd.cwd(), "refs"))
def test_setup_gitweb(self):
repo = c.app.repo
repo_name = c.project.shortname + c.app.config.options.mount_point
git.setup_gitweb(repo_name, repo.repo_dir)