aboutsummaryrefslogtreecommitdiff
path: root/gitosis/test/test_access.py
diff options
context:
space:
mode:
authorTommi Virtanen <tv@inoi.fi>2007-08-11 16:05:26 -0700
committerTommi Virtanen <tv@eagain.net>2007-08-11 17:28:52 -0700
commitc1b15d3e481cba65be193e37c04e70b03c7d68ca (patch)
treed8b9f7daec94c65ddcff101999c7300c48a3b69d /gitosis/test/test_access.py
parentAdd .git to gitweb projects list if only that version of path exists. (diff)
downloadgitosis-dakkar-c1b15d3e481cba65be193e37c04e70b03c7d68ca.tar.gz
gitosis-dakkar-c1b15d3e481cba65be193e37c04e70b03c7d68ca.tar.bz2
gitosis-dakkar-c1b15d3e481cba65be193e37c04e70b03c7d68ca.zip
Add a default repository prefix.
Used to fail is gitosis.repositories is not set.
Diffstat (limited to 'gitosis/test/test_access.py')
-rw-r--r--gitosis/test/test_access.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/gitosis/test/test_access.py b/gitosis/test/test_access.py
index b9f2073..66e799c 100644
--- a/gitosis/test/test_access.py
+++ b/gitosis/test/test_access.py
@@ -15,7 +15,7 @@ def test_write_yes_simple():
cfg.set('group fooers', 'members', 'jdoe')
cfg.set('group fooers', 'writable', 'foo/bar')
eq(access.haveAccess(config=cfg, user='jdoe', mode='writable', path='foo/bar'),
- 'foo/bar')
+ 'repositories/foo/bar')
def test_write_no_simple_wouldHaveReadonly():
cfg = RawConfigParser()
@@ -31,7 +31,7 @@ def test_write_yes_map():
cfg.set('group fooers', 'members', 'jdoe')
cfg.set('group fooers', 'map writable foo/bar', 'quux/thud')
eq(access.haveAccess(config=cfg, user='jdoe', mode='writable', path='foo/bar'),
- 'quux/thud')
+ 'repositories/quux/thud')
def test_write_no_map_wouldHaveReadonly():
cfg = RawConfigParser()
@@ -52,7 +52,7 @@ def test_read_yes_simple():
cfg.set('group fooers', 'members', 'jdoe')
cfg.set('group fooers', 'readonly', 'foo/bar')
eq(access.haveAccess(config=cfg, user='jdoe', mode='readonly', path='foo/bar'),
- 'foo/bar')
+ 'repositories/foo/bar')
def test_read_yes_simple_wouldHaveWritable():
cfg = RawConfigParser()
@@ -68,7 +68,7 @@ def test_read_yes_map():
cfg.set('group fooers', 'members', 'jdoe')
cfg.set('group fooers', 'map readonly foo/bar', 'quux/thud')
eq(access.haveAccess(config=cfg, user='jdoe', mode='readonly', path='foo/bar'),
- 'quux/thud')
+ 'repositories/quux/thud')
def test_read_yes_map_wouldHaveWritable():
cfg = RawConfigParser()
@@ -111,6 +111,16 @@ def test_base_global_relative_simple():
config=cfg, user='jdoe', mode='readonly', path='xyzzy'),
'some/relative/path/xyzzy')
+def test_base_global_unset():
+ cfg = RawConfigParser()
+ cfg.add_section('gitosis')
+ cfg.add_section('group fooers')
+ cfg.set('group fooers', 'members', 'jdoe')
+ cfg.set('group fooers', 'readonly', 'foo xyzzy bar')
+ eq(access.haveAccess(
+ config=cfg, user='jdoe', mode='readonly', path='xyzzy'),
+ 'repositories/xyzzy')
+
def test_base_local():
cfg = RawConfigParser()
cfg.add_section('group fooers')
@@ -128,4 +138,4 @@ def test_dotgit():
cfg.set('group fooers', 'members', 'jdoe')
cfg.set('group fooers', 'writable', 'foo/bar')
eq(access.haveAccess(config=cfg, user='jdoe', mode='writable', path='foo/bar.git'),
- 'foo/bar')
+ 'repositories/foo/bar')