aboutsummaryrefslogtreecommitdiff
path: root/gitosis/test/test_serve.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitosis/test/test_serve.py')
-rw-r--r--gitosis/test/test_serve.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/gitosis/test/test_serve.py b/gitosis/test/test_serve.py
index f5785f5..deb9637 100644
--- a/gitosis/test/test_serve.py
+++ b/gitosis/test/test_serve.py
@@ -117,6 +117,39 @@ def test_simple_read():
)
eq(got, "git-upload-pack '%s/foo.git'" % tmp)
+def test_simple_read_absolute():
+ tmp = util.maketemp()
+ full_path = os.path.join(tmp, 'foo.git')
+ repository.init(full_path)
+ 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', 'readonly', 'foo')
+ got = serve.serve(
+ cfg=cfg,
+ user='jdoe',
+ command="git-upload-pack '%s'" % (full_path, ),
+ )
+ eq(got, "git-upload-pack '%s/foo.git'" % tmp)
+
+def test_simple_read_leading_slash():
+ 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', 'readonly', 'foo')
+ got = serve.serve(
+ cfg=cfg,
+ user='jdoe',
+ command="git-upload-pack '/foo'",
+ )
+ eq(got, "git-upload-pack '%s/foo.git'" % tmp)
+
def test_simple_write():
tmp = util.maketemp()
repository.init(os.path.join(tmp, 'foo.git'))