aboutsummaryrefslogtreecommitdiff
path: root/gitosis
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-06-04 14:22:45 +0300
committerTommi Virtanen <tv@eagain.net>2007-06-04 14:22:45 +0300
commit085e5fffa767c3e91ea9e73dfb579fa9d44579cd (patch)
tree86b7803be5b21aece87c71cef3c8c9a66a44df04 /gitosis
parentAdd debug logging to haveAccess. (diff)
downloadgitosis-dakkar-085e5fffa767c3e91ea9e73dfb579fa9d44579cd.tar.gz
gitosis-dakkar-085e5fffa767c3e91ea9e73dfb579fa9d44579cd.tar.bz2
gitosis-dakkar-085e5fffa767c3e91ea9e73dfb579fa9d44579cd.zip
writeAuthorizedKeys now reads old file by name, not by open file.
Diffstat (limited to 'gitosis')
-rw-r--r--gitosis/test/test_ssh.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gitosis/test/test_ssh.py b/gitosis/test/test_ssh.py
index e699506..9132c16 100644
--- a/gitosis/test/test_ssh.py
+++ b/gitosis/test/test_ssh.py
@@ -171,7 +171,9 @@ class WriteAuthorizedKeys_Test(object):
def test_simple(self):
tmp = maketemp()
path = os.path.join(tmp, 'authorized_keys')
- oldfp = StringIO('''\
+ f = file(path, 'w')
+ try:
+ f.write('''\
# foo
bar
### autogenerated by gitosis, DO NOT EDIT
@@ -179,12 +181,14 @@ command="/foo/bar/baz/gitosis-serve wsmith",no-port-forwarding,\
no-X11-forwarding,no-agent-forwarding,no-pty %(key_2)s
baz
''' % dict(key_2=KEY_2))
+ finally:
+ f.close()
keydir = os.path.join(tmp, 'one')
mkdir(keydir)
writeFile(os.path.join(keydir, 'jdoe.pub'), KEY_1+'\n')
ssh.writeAuthorizedKeys(
- oldfp=oldfp, newpath=path, keydir=keydir)
+ path=path, keydir=keydir)
f = file(path)
try: