diff options
author | 2007-11-17 14:32:43 +0200 | |
---|---|---|
committer | 2007-11-17 14:32:43 +0200 | |
commit | 2487c658ba2559fccf6f0cb6d279542399448f1c (patch) | |
tree | cc76255dc51e1b3dbdfa2ca26ddbe5f94d4af0b4 | |
parent | generate_fp should be generate_project_list_fp (diff) | |
download | gitosis-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.py | 20 |
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 +''') |