aboutsummaryrefslogtreecommitdiff
path: root/gitosis/test
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-12-18 00:53:27 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2007-12-18 01:12:22 -0800
commit436463e7874524b21d70bdd9bb2be8bae1d3441c (patch)
tree020b0581a4b3d2e3036131deaa41348c3f846a29 /gitosis/test
parentAdd some more testcases. (diff)
downloadgitosis-dakkar-436463e7874524b21d70bdd9bb2be8bae1d3441c.tar.gz
gitosis-dakkar-436463e7874524b21d70bdd9bb2be8bae1d3441c.tar.bz2
gitosis-dakkar-436463e7874524b21d70bdd9bb2be8bae1d3441c.zip
Add more testcases, and add coverage exclusion notations on places where we do test the the content functions already, or they interact with the system too much to test for coverage automatically.
Diffstat (limited to 'gitosis/test')
-rw-r--r--gitosis/test/test_gitweb.py30
-rw-r--r--gitosis/test/test_zzz_app.py22
2 files changed, 37 insertions, 15 deletions
diff --git a/gitosis/test/test_gitweb.py b/gitosis/test/test_gitweb.py
index 8bf6d10..e538ec7 100644
--- a/gitosis/test/test_gitweb.py
+++ b/gitosis/test/test_gitweb.py
@@ -223,22 +223,22 @@ def test_description_again():
got = readFile(os.path.join(path, 'description'))
eq(got, 'foodesc\n')
-def test_escape_filename_normal()
- i = 'abc'
- eq(gitweb._escape_filename(i), 'abc')
+def test_escape_filename_normal():
+ i = 'abc'
+ eq(gitweb._escape_filename(i), 'abc')
-def test_escape_filename_slashone()
- i = 'ab\\c'
- eq(gitweb._escape_filename(i), 'ab\\\\c')
+def test_escape_filename_slashone():
+ i = 'ab\\c'
+ eq(gitweb._escape_filename(i), 'ab\\\\c')
-def test_escape_filename_slashtwo()
- i = 'ab\\\\c'
- eq(gitweb._escape_filename(i), 'ab\\\\\\\\c')
+def test_escape_filename_slashtwo():
+ i = 'ab\\\\c'
+ eq(gitweb._escape_filename(i), 'ab\\\\\\\\c')
-def test_escape_filename_dollar()
- i = 'abc$'
- eq(gitweb._escape_filename(i), 'abc\\$')
+def test_escape_filename_dollar():
+ i = 'abc$'
+ eq(gitweb._escape_filename(i), 'abc\\$')
-def test_escape_filename_quote()
- i = 'abc"'
- eq(gitweb._escape_filename(i), 'abc\\"')
+def test_escape_filename_quote():
+ i = 'abc"'
+ eq(gitweb._escape_filename(i), 'abc\\"')
diff --git a/gitosis/test/test_zzz_app.py b/gitosis/test/test_zzz_app.py
index cb20eb6..27ba697 100644
--- a/gitosis/test/test_zzz_app.py
+++ b/gitosis/test/test_zzz_app.py
@@ -1,6 +1,9 @@
from nose.tools import eq_ as eq, assert_raises
from gitosis import app
+from gitosis import init
+from gitosis import run_hook
+from gitosis import serve
import sys
import os
@@ -70,6 +73,25 @@ def test_app_setup_logging_badname():
cfg.set('gitosis', 'loglevel', 'FOOBAR')
main.setup_logging(cfg)
+def test_appinit_create_parser():
+ main = init.Main()
+ parser = main.create_parser()
+
+def test_appinit_read_config():
+ main = init.Main()
+ cfg = main.create_config(None)
+ parser = main.create_parser()
+ (options, args) = parser.parse_args(['--config=/does/not/exist'])
+ main.read_config(options, cfg)
+
+def test_apprunhook_create_parser():
+ main = run_hook.Main()
+ parser = main.create_parser()
+
+def test_appserve_create_parser():
+ main = serve.Main()
+ parser = main.create_parser()
+
# We must call this test last
def test_zzz_app_main():
class Main(TestMain):