/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_smart_transport.py

  • Committer: Alexander Belchenko
  • Date: 2008-02-06 13:43:53 UTC
  • mfrom: (3211 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3231.
  • Revision ID: bialix@ukr.net-20080206134353-hmkib323nxgq3tw6
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1420
1420
        self.assertContainsRe(test_log, 'Traceback')
1421
1421
        self.assertContainsRe(test_log, 'SmartProtocolError')
1422
1422
 
 
1423
    def test_connection_closed_reporting(self):
 
1424
        input = StringIO()
 
1425
        output = StringIO()
 
1426
        client_medium = medium.SmartSimplePipesClientMedium(input, output)
 
1427
        request = client_medium.get_request()
 
1428
        smart_protocol = self.client_protocol_class(request)
 
1429
        smart_protocol.call('hello')
 
1430
        ex = self.assertRaises(errors.ConnectionReset, 
 
1431
            smart_protocol.read_response_tuple)
 
1432
        self.assertEqual("Connection closed: "
 
1433
            "please check connectivity and permissions "
 
1434
            "(and try -Dhpss if further diagnosis is required)", str(ex))
 
1435
 
1423
1436
 
1424
1437
class TestSmartProtocolOne(TestSmartProtocol, CommonSmartProtocolTestMixin):
1425
1438
    """Tests for the smart protocol version one."""
1455
1468
        self.assertOffsetSerialisation([(1,2), (3,4), (100, 200)],
1456
1469
            '1,2\n3,4\n100,200', self.client_protocol)
1457
1470
 
1458
 
    def test_connection_closed_reporting(self):
1459
 
        input = StringIO()
1460
 
        output = StringIO()
1461
 
        client_medium = medium.SmartSimplePipesClientMedium(input, output)
1462
 
        request = client_medium.get_request()
1463
 
        smart_protocol = protocol.SmartClientRequestProtocolOne(request)
1464
 
        smart_protocol.call('hello')
1465
 
        ex = self.assertRaises(errors.ConnectionReset, 
1466
 
            smart_protocol.read_response_tuple)
1467
 
        self.assertEqual("Connection closed: "
1468
 
            "please check connectivity and permissions "
1469
 
            "(and try -Dhpss if further diagnosis is required)", str(ex))
1470
 
 
1471
1471
    def test_accept_bytes_of_bad_request_to_protocol(self):
1472
1472
        out_stream = StringIO()
1473
1473
        smart_protocol = protocol.SmartServerRequestProtocolOne(