aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/testutils
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-06-28 15:53:43 +0200
committerGuido Günther <agx@sigxcpu.org>2016-06-28 17:07:43 +0200
commit2e530138857c2a9e4d743461a38dff438d0b67c6 (patch)
tree72e59610df103e9dc80d5fd46d1c94ab0a119350 /tests/testutils
parente398d8ba38be32a824860aa03b7ac270d3677d1d (diff)
debiantestgitrepo: Allow to inject repo class name
This allows us to use the helpers for other repo types as well
Diffstat (limited to 'tests/testutils')
-rw-r--r--tests/testutils/debiangittestrepo.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/testutils/debiangittestrepo.py b/tests/testutils/debiangittestrepo.py
index 61456f1e..09bf8a70 100644
--- a/tests/testutils/debiangittestrepo.py
+++ b/tests/testutils/debiangittestrepo.py
@@ -10,11 +10,14 @@ import gbp.deb.git
class DebianGitTestRepo(unittest.TestCase):
"""Scratch repo for a single unit test"""
- def setUp(self):
+ def setUp(self, repo_cls=None):
self.tmpdir = context.new_tmpdir(__name__)
+ if repo_cls is None:
+ repo_cls = gbp.deb.git.DebianGitRepository
+
repodir = self.tmpdir.join('test_repo')
- self.repo = gbp.deb.git.DebianGitRepository.create(repodir)
+ self.repo = repo_cls.create(repodir)
def tearDown(self):
context.teardown()