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: