aboutsummaryrefslogtreecommitdiff
path: root/gitosis/test/test_access.py
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-11-15 20:56:15 +0200
committerTommi Virtanen <tv@eagain.net>2007-11-15 20:56:15 +0200
commita2e54704265b58abaa7a6edd0b64548974c69334 (patch)
treea78c9bc4e54cba195a12805917217ecce1ed3aca /gitosis/test/test_access.py
parentFix copy-paste that made gitosis.gitweb use wrong logger. (diff)
downloadgitosis-dakkar-a2e54704265b58abaa7a6edd0b64548974c69334.tar.gz
gitosis-dakkar-a2e54704265b58abaa7a6edd0b64548974c69334.tar.bz2
gitosis-dakkar-a2e54704265b58abaa7a6edd0b64548974c69334.zip
Create leading directories when creating missing repos in gitosis-serve.
Creation is in gitosis.serve and not directly in repository.init(), because that's the location that can tell what part of the directory tree is allowed to be missing. Made the reconstructed git command include the extension as that was easier to do. haveAccess return value is now tuple, to preserve information on what parts of the path can be missing.
Diffstat (limited to 'gitosis/test/test_access.py')
-rw-r--r--gitosis/test/test_access.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/gitosis/test/test_access.py b/gitosis/test/test_access.py
index 66e799c..9f9d81a 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'),
- 'repositories/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'),
- 'repositories/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'),
- 'repositories/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'),
- 'repositories/quux/thud')
+ ('repositories', 'quux/thud'))
def test_read_yes_map_wouldHaveWritable():
cfg = RawConfigParser()
@@ -87,7 +87,7 @@ def test_base_global_absolute():
cfg.set('group fooers', 'map writable foo/bar', 'baz/quux/thud')
eq(access.haveAccess(
config=cfg, user='jdoe', mode='writable', path='foo/bar'),
- '/a/leading/path/baz/quux/thud')
+ ('/a/leading/path', 'baz/quux/thud'))
def test_base_global_relative():
cfg = RawConfigParser()
@@ -98,7 +98,7 @@ def test_base_global_relative():
cfg.set('group fooers', 'map writable foo/bar', 'baz/quux/thud')
eq(access.haveAccess(
config=cfg, user='jdoe', mode='writable', path='foo/bar'),
- 'some/relative/path/baz/quux/thud')
+ ('some/relative/path', 'baz/quux/thud'))
def test_base_global_relative_simple():
cfg = RawConfigParser()
@@ -109,7 +109,7 @@ def test_base_global_relative_simple():
cfg.set('group fooers', 'readonly', 'foo xyzzy bar')
eq(access.haveAccess(
config=cfg, user='jdoe', mode='readonly', path='xyzzy'),
- 'some/relative/path/xyzzy')
+ ('some/relative/path', 'xyzzy'))
def test_base_global_unset():
cfg = RawConfigParser()
@@ -119,7 +119,7 @@ def test_base_global_unset():
cfg.set('group fooers', 'readonly', 'foo xyzzy bar')
eq(access.haveAccess(
config=cfg, user='jdoe', mode='readonly', path='xyzzy'),
- 'repositories/xyzzy')
+ ('repositories', 'xyzzy'))
def test_base_local():
cfg = RawConfigParser()
@@ -129,7 +129,7 @@ def test_base_local():
cfg.set('group fooers', 'map writable foo/bar', 'baz/quux/thud')
eq(access.haveAccess(
config=cfg, user='jdoe', mode='writable', path='foo/bar'),
- 'some/relative/path/baz/quux/thud')
+ ('some/relative/path', 'baz/quux/thud'))
def test_dotgit():
# a .git extension is always allowed to be added
@@ -138,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'),
- 'repositories/foo/bar')
+ ('repositories', 'foo/bar'))