/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 breezy/tests/test_smart_transport.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-30 19:32:13 UTC
  • mfrom: (6637 work)
  • mto: This revision was merged to the branch mainline in revision 6639.
  • Revision ID: jelmer@jelmer.uk-20170530193213-qm21s6dc7dln237t
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2703
2703
        smart_protocol.call('foo')
2704
2704
        smart_protocol.read_response_tuple(True)
2705
2705
        stream = smart_protocol.read_streamed_body()
2706
 
        self.assertRaises(errors.ConnectionReset, stream.next)
 
2706
        self.assertRaises(errors.ConnectionReset, next, stream)
2707
2707
 
2708
2708
    def test_client_read_response_tuple_sets_response_status(self):
2709
2709
        server_bytes = protocol.RESPONSE_VERSION_TWO + "success\nok\n"
2917
2917
    def test_interrupted_by_error(self):
2918
2918
        response_handler = self.make_response_handler(interrupted_body_stream)
2919
2919
        stream = response_handler.read_streamed_body()
2920
 
        self.assertEqual('aaa', stream.next())
2921
 
        self.assertEqual('bbb', stream.next())
2922
 
        exc = self.assertRaises(errors.ErrorFromSmartServer, stream.next)
 
2920
        self.assertEqual('aaa', next(stream))
 
2921
        self.assertEqual('bbb', next(stream))
 
2922
        exc = self.assertRaises(errors.ErrorFromSmartServer, next, stream)
2923
2923
        self.assertEqual(('error', 'Exception', 'Boom!'), exc.error_tuple)
2924
2924
 
2925
2925
    def test_interrupted_by_connection_lost(self):
2929
2929
            'b\0\0\xff\xffincomplete chunk')
2930
2930
        response_handler = self.make_response_handler(interrupted_body_stream)
2931
2931
        stream = response_handler.read_streamed_body()
2932
 
        self.assertRaises(errors.ConnectionReset, stream.next)
 
2932
        self.assertRaises(errors.ConnectionReset, next, stream)
2933
2933
 
2934
2934
    def test_read_body_bytes_interrupted_by_connection_lost(self):
2935
2935
        interrupted_body_stream = (