~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

(John Arbash Meinel) Fix bug #75721: 'bzr push' should only connect a single time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
                          TestCaseWithTransport,
49
49
                          TestSkipped,
50
50
                          )
 
51
from bzrlib.tests.bzrdir_implementations import TestCaseWithBzrDir
51
52
from bzrlib.trace import mutter
52
53
from bzrlib.transport import get_transport
53
54
from bzrlib.upgrade import upgrade
55
56
from bzrlib.repofmt import weaverepo
56
57
 
57
58
 
58
 
class TestCaseWithBzrDir(TestCaseWithTransport):
59
 
 
60
 
    def setUp(self):
61
 
        super(TestCaseWithBzrDir, self).setUp()
62
 
        self.bzrdir = None
63
 
 
64
 
    def get_bzrdir(self):
65
 
        if self.bzrdir is None:
66
 
            self.bzrdir = self.make_bzrdir(None)
67
 
        return self.bzrdir
68
 
 
69
 
    def make_bzrdir(self, relpath, format=None):
70
 
        return super(TestCaseWithBzrDir, self).make_bzrdir(
71
 
            relpath, format=self.bzrdir_format)
72
 
 
73
 
 
74
 
 
75
59
class TestBzrDir(TestCaseWithBzrDir):
76
60
    # Many of these tests test for disk equality rather than checking
77
61
    # for semantic equivalence. This works well for some tests but
191
175
            # so this test is irrelevant.
192
176
            return
193
177
        self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)
194
 
            
 
178
 
 
179
    def test_clone_on_transport(self):
 
180
        a_dir = self.make_bzrdir('source')
 
181
        target_transport = a_dir.root_transport.clone('..').clone('target')
 
182
        target = a_dir.clone_on_transport(target_transport)
 
183
        self.assertNotEqual(a_dir.transport.base, target.transport.base)
 
184
        self.assertDirectoriesEqual(a_dir.root_transport, target.root_transport,
 
185
                                    ['./.bzr/merge-hashes'])
 
186
 
195
187
    def test_clone_bzrdir_empty(self):
196
188
        dir = self.make_bzrdir('source')
197
189
        target = dir.clone(self.get_url('target'))