diff options
author | 2007-06-05 14:05:54 +0300 | |
---|---|---|
committer | 2007-06-05 14:05:54 +0300 | |
commit | 8a6cb39b9f8f86ac77ce0163e8b1779211a2f8b6 (patch) | |
tree | e87eac9c12cecc06b00ef202e3c8866ae54e3386 | |
parent | Clean up gitosis.gitweb unit tests. (diff) | |
download | gitosis-gentoo-8a6cb39b9f8f86ac77ce0163e8b1779211a2f8b6.tar.gz gitosis-gentoo-8a6cb39b9f8f86ac77ce0163e8b1779211a2f8b6.tar.bz2 gitosis-gentoo-8a6cb39b9f8f86ac77ce0163e8b1779211a2f8b6.zip |
Extract test utility functions.
-rw-r--r-- | gitosis/test/test_ssh.py | 20 | ||||
-rw-r--r-- | gitosis/test/util.py | 18 |
2 files changed, 20 insertions, 18 deletions
diff --git a/gitosis/test/test_ssh.py b/gitosis/test/test_ssh.py index 9132c16..8fe18c9 100644 --- a/gitosis/test/test_ssh.py +++ b/gitosis/test/test_ssh.py @@ -1,26 +1,10 @@ from nose.tools import eq_ as eq, assert_raises -import os, errno +import os from cStringIO import StringIO from gitosis import ssh - -def mkdir(path): - try: - os.mkdir(path) - except OSError, e: - if e.errno == errno.EEXIST: - pass - else: - raise - -def maketemp(): - tmp = os.path.join(os.path.dirname(__file__), 'tmp') - mkdir(tmp) - me = os.path.splitext(os.path.basename(__file__))[0] - tmp = os.path.join(tmp, me) - mkdir(tmp) - return tmp +from gitosis.test.util import mkdir, maketemp def writeFile(path, content): tmp = '%s.tmp' % path diff --git a/gitosis/test/util.py b/gitosis/test/util.py new file mode 100644 index 0000000..fa3a2be --- /dev/null +++ b/gitosis/test/util.py @@ -0,0 +1,18 @@ +import os, errno + +def mkdir(path): + try: + os.mkdir(path) + except OSError, e: + if e.errno == errno.EEXIST: + pass + else: + raise + +def maketemp(): + tmp = os.path.join(os.path.dirname(__file__), 'tmp') + mkdir(tmp) + me = os.path.splitext(os.path.basename(__file__))[0] + tmp = os.path.join(tmp, me) + mkdir(tmp) + return tmp |