~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    branch,
31
31
    bzrdir,
32
32
    config,
 
33
    controldir,
33
34
    errors,
34
35
    graph,
35
36
    inventory,
36
37
    inventory_delta,
37
 
    pack,
38
38
    remote,
39
39
    repository,
40
40
    tests,
41
41
    transport,
42
42
    treebuilder,
43
 
    urlutils,
44
43
    versionedfile,
45
44
    )
46
45
from bzrlib.branch import Branch
47
 
from bzrlib.bzrdir import BzrDir, BzrDirFormat
 
46
from bzrlib.bzrdir import (
 
47
    BzrDir,
 
48
    BzrDirFormat,
 
49
    RemoteBzrProber,
 
50
    )
48
51
from bzrlib.remote import (
49
52
    RemoteBranch,
50
53
    RemoteBranchFormat,
51
54
    RemoteBzrDir,
52
 
    RemoteBzrDirFormat,
53
55
    RemoteRepository,
54
56
    RemoteRepositoryFormat,
55
57
    )
89
91
        self.transport = self.get_transport()
90
92
        # make a branch that can be opened over the smart transport
91
93
        self.local_wt = BzrDir.create_standalone_workingtree('.')
92
 
 
93
 
    def tearDown(self):
94
 
        self.transport.disconnect()
95
 
        tests.TestCaseWithTransport.tearDown(self)
 
94
        self.addCleanup(self.transport.disconnect)
96
95
 
97
96
    def test_create_remote_bzrdir(self):
98
97
        b = remote.RemoteBzrDir(self.transport, remote.RemoteBzrDirFormat())
122
121
    def test_find_correct_format(self):
123
122
        """Should open a RemoteBzrDir over a RemoteTransport"""
124
123
        fmt = BzrDirFormat.find_format(self.transport)
125
 
        self.assertTrue(RemoteBzrDirFormat
126
 
                        in BzrDirFormat._control_server_formats)
 
124
        self.assertTrue(bzrdir.RemoteBzrProber
 
125
                        in controldir.ControlDirFormat._server_probers)
127
126
        self.assertIsInstance(fmt, remote.RemoteBzrDirFormat)
128
127
 
129
128
    def test_open_detected_smart_format(self):
686
685
        old.
687
686
        """
688
687
        self.assertRaises(errors.NotBranchError,
689
 
            RemoteBzrDirFormat.probe_transport, OldServerTransport())
 
688
            RemoteBzrProber.probe_transport, OldServerTransport())
690
689
 
691
690
 
692
691
class TestBzrDirCreateBranch(TestRemote):