aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-11-17 14:32:43 +0200
committerTommi Virtanen <tv@eagain.net>2007-11-17 14:32:43 +0200
commit2487c658ba2559fccf6f0cb6d279542399448f1c (patch)
treecc76255dc51e1b3dbdfa2ca26ddbe5f94d4af0b4
parentgenerate_fp should be generate_project_list_fp (diff)
downloadgitosis-gentoo-2487c658ba2559fccf6f0cb6d279542399448f1c.tar.gz
gitosis-gentoo-2487c658ba2559fccf6f0cb6d279542399448f1c.tar.bz2
gitosis-gentoo-2487c658ba2559fccf6f0cb6d279542399448f1c.zip
Add unit test for gitweb.generate_project_list.
-rw-r--r--gitosis/test/test_gitweb.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/gitosis/test/test_gitweb.py b/gitosis/test/test_gitweb.py
index ca42a76..cf37a44 100644
--- a/gitosis/test/test_gitweb.py
+++ b/gitosis/test/test_gitweb.py
@@ -5,7 +5,7 @@ from ConfigParser import RawConfigParser
from cStringIO import StringIO
from gitosis import gitweb
-from gitosis.test.util import mkdir, maketemp
+from gitosis.test.util import mkdir, maketemp, readFile
def test_projectsList_empty():
cfg = RawConfigParser()
@@ -105,3 +105,21 @@ def test_projectsList_reallyEndsWithGit():
eq(got.getvalue(), '''\
foo.git
''')
+
+def test_projectsList_path():
+ tmp = maketemp()
+ path = os.path.join(tmp, 'foo.git')
+ mkdir(path)
+ cfg = RawConfigParser()
+ cfg.add_section('gitosis')
+ cfg.set('gitosis', 'repositories', tmp)
+ cfg.add_section('repo foo')
+ cfg.set('repo foo', 'gitweb', 'yes')
+ projects_list = os.path.join(tmp, 'projects.list')
+ gitweb.generate_project_list(
+ config=cfg,
+ path=projects_list)
+ got = readFile(projects_list)
+ eq(got, '''\
+foo.git
+''')