~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: abentley
  • Date: 2006-04-20 23:47:53 UTC
  • mfrom: (1681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: abentley@lappy-20060420234753-6a6874b76f09f86d
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from bzrlib.tests import (
30
30
                          adapt_modules,
31
31
                          default_transport,
32
 
                          TestCaseWithTransport,
33
32
                          TestLoader,
34
33
                          TestSuite,
35
34
                          )
 
35
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
36
36
from bzrlib.workingtree import (WorkingTreeFormat,
37
37
                                WorkingTreeTestProviderAdapter,
38
38
                                _legacy_formats,
39
39
                                )
40
40
 
41
41
 
42
 
class TestCaseWithWorkingTree(TestCaseWithTransport):
43
 
 
44
 
    def make_bzrdir(self, relpath):
45
 
        # todo factor out into bzrdir-using-implementations-tests-base-class
46
 
        try:
47
 
            url = self.get_url(relpath)
48
 
            segments = url.split('/')
49
 
            if segments and segments[-1] not in ('', '.'):
50
 
                parent = '/'.join(segments[:-1])
51
 
                t = get_transport(parent)
52
 
                try:
53
 
                    t.mkdir(segments[-1])
54
 
                except errors.FileExists:
55
 
                    pass
56
 
            return self.bzrdir_format.initialize(url)
57
 
        except errors.UninitializableFormat:
58
 
            raise TestSkipped("Format %s is not initializable.")
59
 
 
60
 
    def make_branch_and_tree(self, relpath):
61
 
        made_control = self.make_bzrdir(relpath)
 
42
class TestCaseWithWorkingTree(TestCaseWithBzrDir):
 
43
 
 
44
    def make_branch_and_tree(self, relpath, format=None):
 
45
        made_control = self.make_bzrdir(relpath, format=format)
62
46
        made_control.create_repository()
63
47
        made_control.create_branch()
64
48
        return self.workingtree_format.initialize(made_control)
67
51
def test_suite():
68
52
    result = TestSuite()
69
53
    test_workingtree_implementations = [
 
54
        'bzrlib.tests.workingtree_implementations.test_basis_inventory',
70
55
        'bzrlib.tests.workingtree_implementations.test_is_control_filename',
71
56
        'bzrlib.tests.workingtree_implementations.test_pull',
72
57
        'bzrlib.tests.workingtree_implementations.test_workingtree',