~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_transport.py

  • Committer: Vincent Ladeuil
  • Date: 2011-07-06 09:22:00 UTC
  • mfrom: (6008 +trunk)
  • mto: (6012.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6013.
  • Revision ID: v.ladeuil+lp@free.fr-20110706092200-7iai2mwzc0sqdsvf
MergingĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1493
1493
        smart_protocol._has_dispatched = True
1494
1494
        smart_protocol.request = _mod_request.SmartServerRequestHandler(
1495
1495
            None, _mod_request.request_handlers, '/')
 
1496
        # GZ 2010-08-10: Cycle with closure affects 4 tests
1496
1497
        class FakeCommand(_mod_request.SmartServerRequest):
1497
1498
            def do_body(self_cmd, body_bytes):
1498
1499
                self.end_received = True
2412
2413
        self.assertEqual('aaa', stream.next())
2413
2414
        self.assertEqual('bbb', stream.next())
2414
2415
        exc = self.assertRaises(errors.ErrorFromSmartServer, stream.next)
2415
 
        self.assertEqual(('error', 'Boom!'), exc.error_tuple)
 
2416
        self.assertEqual(('error', 'Exception', 'Boom!'), exc.error_tuple)
2416
2417
 
2417
2418
    def test_interrupted_by_connection_lost(self):
2418
2419
        interrupted_body_stream = (
2815
2816
    'b\x00\x00\x00\x03aaa' # body part ('aaa')
2816
2817
    'b\x00\x00\x00\x03bbb' # body part ('bbb')
2817
2818
    'oE' # status flag (error)
2818
 
    's\x00\x00\x00\x10l5:error5:Boom!e' # err struct ('error', 'Boom!')
 
2819
    # err struct ('error', 'Exception', 'Boom!')
 
2820
    's\x00\x00\x00\x1bl5:error9:Exception5:Boom!e'
2819
2821
    'e' # EOM
2820
2822
    )
2821
2823