~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Martin
  • Date: 2010-05-16 15:18:43 UTC
  • mfrom: (5235 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5239.
  • Revision ID: gzlist@googlemail.com-20100516151843-lu53u7caehm3ie3i
Merge bzr.dev to resolve conflicts in NEWS and _chk_map_pyx

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    branch,
31
31
    bzrdir,
32
32
    config,
33
 
    controldir,
34
33
    errors,
35
34
    graph,
36
35
    inventory,
37
36
    inventory_delta,
 
37
    pack,
38
38
    remote,
39
39
    repository,
40
40
    tests,
41
 
    transport,
42
41
    treebuilder,
 
42
    urlutils,
43
43
    versionedfile,
44
44
    )
45
45
from bzrlib.branch import Branch
46
 
from bzrlib.bzrdir import (
47
 
    BzrDir,
48
 
    BzrDirFormat,
49
 
    RemoteBzrProber,
50
 
    )
 
46
from bzrlib.bzrdir import BzrDir, BzrDirFormat
51
47
from bzrlib.remote import (
52
48
    RemoteBranch,
53
49
    RemoteBranchFormat,
54
50
    RemoteBzrDir,
 
51
    RemoteBzrDirFormat,
55
52
    RemoteRepository,
56
53
    RemoteRepositoryFormat,
57
54
    )
66
63
    multiply_tests,
67
64
    test_server,
68
65
    )
 
66
from bzrlib.transport import get_transport
69
67
from bzrlib.transport.memory import MemoryTransport
70
68
from bzrlib.transport.remote import (
71
69
    RemoteTransport,
91
89
        self.transport = self.get_transport()
92
90
        # make a branch that can be opened over the smart transport
93
91
        self.local_wt = BzrDir.create_standalone_workingtree('.')
94
 
        self.addCleanup(self.transport.disconnect)
 
92
 
 
93
    def tearDown(self):
 
94
        self.transport.disconnect()
 
95
        tests.TestCaseWithTransport.tearDown(self)
95
96
 
96
97
    def test_create_remote_bzrdir(self):
97
98
        b = remote.RemoteBzrDir(self.transport, remote.RemoteBzrDirFormat())
121
122
    def test_find_correct_format(self):
122
123
        """Should open a RemoteBzrDir over a RemoteTransport"""
123
124
        fmt = BzrDirFormat.find_format(self.transport)
124
 
        self.assertTrue(bzrdir.RemoteBzrProber
125
 
                        in controldir.ControlDirFormat._server_probers)
 
125
        self.assertTrue(RemoteBzrDirFormat
 
126
                        in BzrDirFormat._control_server_formats)
126
127
        self.assertIsInstance(fmt, remote.RemoteBzrDirFormat)
127
128
 
128
129
    def test_open_detected_smart_format(self):
358
359
        a given client_base and transport_base.
359
360
        """
360
361
        client_medium = medium.SmartClientMedium(client_base)
361
 
        t = transport.get_transport(transport_base)
362
 
        result = client_medium.remote_path_from_transport(t)
 
362
        transport = get_transport(transport_base)
 
363
        result = client_medium.remote_path_from_transport(transport)
363
364
        self.assertEqual(expected, result)
364
365
 
365
366
    def test_remote_path_from_transport(self):
376
377
        a given transport_base and relpath of that transport.  (Note that
377
378
        HttpTransportBase is a subclass of SmartClientMedium)
378
379
        """
379
 
        base_transport = transport.get_transport(transport_base)
 
380
        base_transport = get_transport(transport_base)
380
381
        client_medium = base_transport.get_smart_medium()
381
382
        cloned_transport = base_transport.clone(relpath)
382
383
        result = client_medium.remote_path_from_transport(cloned_transport)
685
686
        old.
686
687
        """
687
688
        self.assertRaises(errors.NotBranchError,
688
 
            RemoteBzrProber.probe_transport, OldServerTransport())
 
689
            RemoteBzrDirFormat.probe_transport, OldServerTransport())
689
690
 
690
691
 
691
692
class TestBzrDirCreateBranch(TestRemote):
1617
1618
    def test_get_multi_line_branch_conf(self):
1618
1619
        # Make sure that multiple-line branch.conf files are supported
1619
1620
        #
1620
 
        # https://bugs.launchpad.net/bzr/+bug/354075
 
1621
        # https://bugs.edge.launchpad.net/bzr/+bug/354075
1621
1622
        client = FakeClient()
1622
1623
        client.add_expected_call(
1623
1624
            'Branch.get_stacked_on_url', ('memory:///',),