diff options
author | Tommi Virtanen <tv@eagain.net> | 2007-08-29 22:28:53 -0700 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2007-08-29 22:28:53 -0700 |
commit | f86b354744651cddf766a7532805b90d806eda08 (patch) | |
tree | 30336529cf764011fdc293d60b39cf2d9c9ecf12 /gitosis/test/test_ssh.py | |
parent | Fix gitosis-gitweb docstring to match default repository path. (diff) | |
download | gitosis-dakkar-f86b354744651cddf766a7532805b90d806eda08.tar.gz gitosis-dakkar-f86b354744651cddf766a7532805b90d806eda08.tar.bz2 gitosis-dakkar-f86b354744651cddf766a7532805b90d806eda08.zip |
Refactor unit test writeFile/readFile helpers.
Diffstat (limited to 'gitosis/test/test_ssh.py')
-rw-r--r-- | gitosis/test/test_ssh.py | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/gitosis/test/test_ssh.py b/gitosis/test/test_ssh.py index 8fe18c9..3b29310 100644 --- a/gitosis/test/test_ssh.py +++ b/gitosis/test/test_ssh.py @@ -4,16 +4,7 @@ import os from cStringIO import StringIO from gitosis import ssh -from gitosis.test.util import mkdir, maketemp - -def writeFile(path, content): - tmp = '%s.tmp' % path - f = file(tmp, 'w') - try: - f.write(content) - finally: - f.close() - os.rename(tmp, path) +from gitosis.test.util import mkdir, maketemp, writeFile, readFile def _key(s): return ''.join(s.split('\n')).strip() @@ -174,12 +165,7 @@ baz ssh.writeAuthorizedKeys( path=path, keydir=keydir) - f = file(path) - try: - got = f.read() - finally: - f.close() - + got = readFile(path) eq(got, '''\ # foo bar |