diff options
author | Tommi Virtanen <tv@eagain.net> | 2008-04-19 19:10:36 +0300 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2008-04-19 19:10:36 +0300 |
commit | 38561aa6a51a2ef6cc04aa119481df62d213ffa4 (patch) | |
tree | 6880f0c0c7ae6d130e3328a88c5e74a89448037f /gitosis/test | |
parent | Show how group sections in config can be used in example.conf. (diff) | |
download | gitosis-dakkar-38561aa6a51a2ef6cc04aa119481df62d213ffa4.tar.gz gitosis-dakkar-38561aa6a51a2ef6cc04aa119481df62d213ffa4.tar.bz2 gitosis-dakkar-38561aa6a51a2ef6cc04aa119481df62d213ffa4.zip |
Understand the popular gitosis.conf typo "writeable".
Log a warning still, don't want that to get too common.
Diffstat (limited to 'gitosis/test')
-rw-r--r-- | gitosis/test/test_access.py | 1 | ||||
-rw-r--r-- | gitosis/test/test_serve.py | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/gitosis/test/test_access.py b/gitosis/test/test_access.py index 751b0b4..f39444c 100644 --- a/gitosis/test/test_access.py +++ b/gitosis/test/test_access.py @@ -1,5 +1,6 @@ from nose.tools import eq_ as eq +import logging from ConfigParser import RawConfigParser from gitosis import access diff --git a/gitosis/test/test_serve.py b/gitosis/test/test_serve.py index a223c43..56d50b0 100644 --- a/gitosis/test/test_serve.py +++ b/gitosis/test/test_serve.py @@ -1,7 +1,9 @@ from nose.tools import eq_ as eq from gitosis.test.util import assert_raises +import logging import os +from cStringIO import StringIO from ConfigParser import RawConfigParser from gitosis import serve @@ -410,3 +412,32 @@ def test_absolute(): command="git-upload-pack '/foo'", ) eq(got, "git-upload-pack '%s/foo.git'" % tmp) + +def test_typo_writeable(): + tmp = util.maketemp() + repository.init(os.path.join(tmp, 'foo.git')) + cfg = RawConfigParser() + cfg.add_section('gitosis') + cfg.set('gitosis', 'repositories', tmp) + cfg.add_section('group foo') + cfg.set('group foo', 'members', 'jdoe') + cfg.set('group foo', 'writeable', 'foo') + log = logging.getLogger('gitosis.serve') + buf = StringIO() + handler = logging.StreamHandler(buf) + log.addHandler(handler) + try: + got = serve.serve( + cfg=cfg, + user='jdoe', + command="git-receive-pack 'foo'", + ) + finally: + log.removeHandler(handler) + eq(got, "git-receive-pack '%s/foo.git'" % tmp) + handler.flush() + eq( + buf.getvalue(), + "Repository 'foo' config has typo \"writeable\", shou" + +"ld be \"writable\"\n", + ) |