diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-05-06 18:53:59 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-05-06 18:53:59 +0200 |
commit | 7ae36c3e019a5cc16924d1b6007774bfb625036f (patch) | |
tree | 52ad2a3cd8187c42a3a02d6b08dda9493a23042b /git/test/lib/base.py | |
parent | acf5e6ea64a2f24117f1d419c208ed1c38c43690 (diff) | |
download | gitpython-7ae36c3e019a5cc16924d1b6007774bfb625036f.tar.gz |
Started to fix imports - tests still have no chance to work as database changed drastically. Now the actual work begins
Diffstat (limited to 'git/test/lib/base.py')
-rw-r--r-- | git/test/lib/base.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/git/test/lib/base.py b/git/test/lib/base.py index 9ed2c4b2..3725d544 100644 --- a/git/test/lib/base.py +++ b/git/test/lib/base.py @@ -3,14 +3,17 @@ # This module is part of PureGitDB and is released under # the New BSD License: http://www.opensource.org/licenses/bsd-license.php """Utilities used in ODB testing""" -from git import OStream +from git.base import OStream from git.db.py import PureGitDB from git.stream import ( Sha1Writer, ZippedStoreShaWriter ) -from git.util import zlib +from git.util import ( + zlib, + dirname + ) import sys import random @@ -31,7 +34,7 @@ def with_rw_directory(func): """Create a temporary directory which can be written to, remove it if the test suceeds, but leave it otherwise to aid additional debugging""" def wrapper(self): - path = tempfile.mktemp(prefix=func.__name__) + path = maketemp(prefix=func.__name__) os.mkdir(path) keep = False try: @@ -64,7 +67,7 @@ def with_rw_repo(func): that should exist Wrapped function obtains a git repository """ def wrapper(self, path): - src_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) + src_dir = dirname(dirname(dirname(__file__))) assert(os.path.isdir(path)) os.rmdir(path) # created by wrapper, but must not exist for copy operation shutil.copytree(src_dir, path) @@ -98,7 +101,7 @@ def with_packs_rw(func): def repo_dir(): """:return: path to our own repository, being our own .git directory. :note: doesn't work in bare repositories""" - base = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), '.git') + base = os.path.join(dirname(dirname(dirname(dirname(__file__)))), '.git') assert os.path.isdir(base) return base @@ -114,7 +117,7 @@ def fixture_path(relapath=''): """:return: absolute path into the fixture directory :param relapath: relative path into the fixtures directory, or '' to obtain the fixture directory itself""" - return os.path.join(os.path.dirname(__file__), 'fixtures', relapath) + return os.path.join(dirname(__file__), 'fixtures', relapath) def copy_files_globbed(source_glob, target_dir, hard_link_ok=False): """Copy all files found according to the given source glob into the target directory |