diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-05-30 13:06:37 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-05-30 13:06:37 +0200 |
commit | 024adf37acddd6a5d8293b6b5d15795c59a142c0 (patch) | |
tree | 3610b99168f984acb0eefe3a995295f4d3b1d096 /git/test/lib/base.py | |
parent | 112bb1672d6b28f203e7839e320b985486636800 (diff) | |
download | gitpython-024adf37acddd6a5d8293b6b5d15795c59a142c0.tar.gz |
Fixed tests far enough to allow basic repository tests to be applied to any of the new database types. This reduces code duplication to the mere minimum, but allows custom tests to be added on top easily and flexibly
Diffstat (limited to 'git/test/lib/base.py')
-rw-r--r-- | git/test/lib/base.py | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/git/test/lib/base.py b/git/test/lib/base.py index 3725d544..221395c9 100644 --- a/git/test/lib/base.py +++ b/git/test/lib/base.py @@ -1,10 +1,9 @@ # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors # -# This module is part of PureGitDB and is released under +# This module is part of PureCmdGitDB and is released under # the New BSD License: http://www.opensource.org/licenses/bsd-license.php """Utilities used in ODB testing""" from git.base import OStream -from git.db.py import PureGitDB from git.stream import ( Sha1Writer, ZippedStoreShaWriter @@ -73,7 +72,7 @@ def with_rw_repo(func): shutil.copytree(src_dir, path) target_gitdir = os.path.join(path, '.git') assert os.path.isdir(target_gitdir) - return func(self, PureGitDB(target_gitdir)) + return func(self, self.RepoCls(target_gitdir)) #END wrapper wrapper.__name__ = func.__name__ return with_rw_directory(wrapper) @@ -98,7 +97,7 @@ def with_packs_rw(func): #{ Routines -def repo_dir(): +def rorepo_dir(): """:return: path to our own repository, being our own .git directory. :note: doesn't work in bare repositories""" base = os.path.join(dirname(dirname(dirname(dirname(__file__)))), '.git') @@ -106,9 +105,9 @@ def repo_dir(): return base -def maketemp(*args): +def maketemp(*args, **kwargs): """Wrapper around default tempfile.mktemp to fix an osx issue""" - tdir = tempfile.mktemp(*args) + tdir = tempfile.mktemp(*args, **kwargs) if sys.platform == 'darwin': tdir = '/private' + tdir return tdir @@ -192,12 +191,3 @@ class DeriveTest(OStream): #} END stream utilitiess -#{ Bases - -class TestBase(unittest.TestCase): - """Base class for all tests""" - # The non-database specific tests just provides a default pure git database - rorepo = PureGitDB(repo_dir()) - -#} END bases - |