summaryrefslogtreecommitdiff
path: root/git/test/performance/lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/test/performance/lib.py')
-rw-r--r--git/test/performance/lib.py38
1 files changed, 16 insertions, 22 deletions
diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py
index 08c0e91c..cf80a0de 100644
--- a/git/test/performance/lib.py
+++ b/git/test/performance/lib.py
@@ -1,18 +1,12 @@
"""Contains library functions"""
import os
-from git.test.lib import TestBase
+from git.test.lib import (
+ TestBase,
+ GlobalsItemDeletorMetaCls
+ )
import shutil
import tempfile
-from git.db import (
- CmdGitDB,
- GitDB
- )
-
-from git import (
- Repo
- )
-
#{ Invvariants
k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE"
#} END invariants
@@ -38,11 +32,7 @@ class TestBigRepoR(TestBase):
* gitrorepo
- * Read-Only git repository - actually the repo of git itself
-
- * puregitrorepo
-
- * As gitrepo, but uses pure python implementation
+ * a big read-only git repository
"""
#{ Invariants
@@ -50,29 +40,33 @@ class TestBigRepoR(TestBase):
head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5'
#} END invariants
+ #{ Configuration
+ RepoCls = None
+ #} END configuration
+
@classmethod
def setUpAll(cls):
super(TestBigRepoR, cls).setUpAll()
- repo_path = resolve_or_fail(k_env_git_repo)
- cls.gitrorepo = Repo(repo_path, odbt=CmdGitDB)
- cls.puregitrorepo = Repo(repo_path, odbt=GitDB)
+ if cls.RepoCls is None:
+ raise AssertionError("Require RepoCls in class %s to be set" % cls)
+ #END assert configuration
+ cls.rorepo = cls.RepoCls(resolve_or_fail(k_env_git_repo))
class TestBigRepoRW(TestBigRepoR):
"""As above, but provides a big repository that we can write to.
- Provides ``self.gitrwrepo`` and ``self.puregitrwrepo``"""
+ Provides ``self.rwrepo``"""
@classmethod
def setUpAll(cls):
super(TestBigRepoRW, cls).setUpAll()
dirname = tempfile.mktemp()
os.mkdir(dirname)
- cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True, odbt=CmdGitDB)
- cls.puregitrwrepo = Repo(dirname, odbt=GitDB)
+ cls.rwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True)
@classmethod
def tearDownAll(cls):
- shutil.rmtree(cls.gitrwrepo.working_dir)
+ shutil.rmtree(cls.rwrepo.working_dir)
#} END base classes