/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-06 10:25:39 UTC
  • mfrom: (3690.1.2 nicer-error)
  • Revision ID: pqm@pqm.ubuntu.com-20080906102539-ss1fkx2csdcalqlc
Do not traceback on unexpected error responses from a smart server.
        (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
704
704
        client._calls = []
705
705
 
706
706
        err = self.assertRaises(
707
 
            errors.ErrorFromSmartServer,
 
707
            errors.UnknownErrorFromSmartServer,
708
708
            branch.set_last_revision_info, 123, 'revid')
709
709
        self.assertEqual(('UnexpectedError',), err.error_tuple)
710
710
        branch.unlock()
1080
1080
        transport_path = 'sinhala'
1081
1081
        repo, client = self.setup_fake_client_and_repository(transport_path)
1082
1082
        client.add_error_response('AnUnexpectedError')
1083
 
        e = self.assertRaises(errors.ErrorFromSmartServer,
 
1083
        e = self.assertRaises(errors.UnknownErrorFromSmartServer,
1084
1084
            self.applyDeprecated, one_four, repo.get_revision_graph, revid)
1085
1085
        self.assertEqual(('AnUnexpectedError',), e.error_tuple)
1086
1086
 
1350
1350
        error_tuple = ('An unknown error tuple',)
1351
1351
        server_error = errors.ErrorFromSmartServer(error_tuple)
1352
1352
        translated_error = self.translateErrorFromSmartServer(server_error)
1353
 
        self.assertEqual(server_error, translated_error)
 
1353
        expected_error = errors.UnknownErrorFromSmartServer(server_error)
 
1354
        self.assertEqual(expected_error, translated_error)
1354
1355
 
1355
1356
    def test_context_missing_a_key(self):
1356
1357
        """In case of a bug in the client, or perhaps an unexpected response