~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Aaron Bentley
  • Date: 2007-05-14 17:21:02 UTC
  • mfrom: (2485 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2528.
  • Revision ID: aaron.bentley@utoronto.ca-20070514172102-byyl4ldjxhfxvryy
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
        d = fmt.open(self.transport)
99
99
        self.assertIsInstance(d, BzrDir)
100
100
 
 
101
    def test_remote_branch_repr(self):
 
102
        b = BzrDir.open_from_transport(self.transport).open_branch()
 
103
        self.assertStartsWith(str(b), 'RemoteBranch(')
 
104
 
101
105
 
102
106
class FakeProtocol(object):
103
107
    """Lookalike SmartClientRequestProtocolOne allowing body reading tests."""
422
426
            [('call', 'Transport.is_readonly', ())],
423
427
            client._calls)
424
428
 
 
429
    def test_error_from_old_0_11_server(self):
 
430
        """Same as test_error_from_old_server, but with the slightly different
 
431
        error message from bzr 0.11 servers.
 
432
        """
 
433
        client = FakeClient([(
 
434
            ('error', "Generic bzr smart protocol error: "
 
435
                      "bad request u'Transport.is_readonly'"), '')])
 
436
        transport = RemoteTransport('bzr://example.com/', medium=False,
 
437
                                    _client=client)
 
438
        self.assertEqual(False, transport.is_readonly())
 
439
        self.assertEqual(
 
440
            [('call', 'Transport.is_readonly', ())],
 
441
            client._calls)
 
442
 
425
443
 
426
444
class TestRemoteRepository(tests.TestCase):
427
445
    """Base for testing RemoteRepository protocol usage.