~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-06-25 09:23:03 UTC
  • mfrom: (2485.7.2 per-repository-test-setup)
  • Revision ID: pqm@pqm.ubuntu.com-20070625092303-yr8bqbke8snrmkig
(robertc) Relocate TestCaseWithRepository to be more central.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
                          TestLoader,
40
40
                          TestSuite,
41
41
                          )
 
42
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
42
43
from bzrlib.transport.memory import MemoryServer
43
44
 
44
45
 
 
46
class TestCaseWithRepository(TestCaseWithBzrDir):
 
47
 
 
48
    def make_repository(self, relpath, format=None):
 
49
        if format is None:
 
50
            # Create a repository of the type we are trying to test.
 
51
            made_control = self.make_bzrdir(relpath)
 
52
            return self.repository_format.initialize(made_control)
 
53
        else:
 
54
            return super(TestCaseWithRepository, self).make_repository(
 
55
                relpath, format)
 
56
 
 
57
 
 
58
 
45
59
def test_suite():
46
60
    result = TestSuite()
47
61
    test_repository_implementations = [