/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: Robert Collins
  • Date: 2007-04-24 11:32:14 UTC
  • mto: (2432.3.5 hpss-vfs-fallback)
  • mto: This revision was merged to the branch mainline in revision 2463.
  • Revision ID: robertc@lifelesswks.robertcollins.net-20070424113214-5660f78098933edb
Refactor the HPSS Response code to take SmartServerResponse rather than args and body.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        medium,
36
36
        protocol,
37
37
        request,
 
38
        request as _mod_request,
38
39
        server,
39
40
        vfs,
40
41
)
1378
1379
        smart_protocol = protocol.SmartServerRequestProtocolOne(
1379
1380
            None, lambda x: None)
1380
1381
        self.assertEqual(1, smart_protocol.next_read_size())
1381
 
        smart_protocol._send_response(('x',))
 
1382
        smart_protocol._send_response(
 
1383
            request.SuccessfulSmartServerResponse(('x',)))
1382
1384
        self.assertEqual(0, smart_protocol.next_read_size())
1383
1385
 
1384
1386
    def test_query_version(self):
1409
1411
            server_output = StringIO()
1410
1412
            server_protocol = protocol.SmartServerRequestProtocolOne(
1411
1413
                None, server_output.write)
1412
 
            server_protocol._send_response(input_tuple)
 
1414
            server_protocol._send_response(
 
1415
                _mod_request.SuccessfulSmartServerResponse(input_tuple))
1413
1416
            self.assertEqual(expected_bytes, server_output.getvalue())
1414
1417
        # check the decoding of the client smart_protocol from expected_bytes:
1415
1418
        input = StringIO(expected_bytes)
1676
1679
        smart_protocol = protocol.SmartServerRequestProtocolTwo(
1677
1680
            None, lambda x: None)
1678
1681
        self.assertEqual(1, smart_protocol.next_read_size())
1679
 
        smart_protocol._send_response(('x',))
 
1682
        smart_protocol._send_response(
 
1683
            request.SuccessfulSmartServerResponse(('x',)))
1680
1684
        self.assertEqual(0, smart_protocol.next_read_size())
1681
1685
 
1682
1686
    def test_query_version(self):
1707
1711
            server_output = StringIO()
1708
1712
            server_protocol = protocol.SmartServerRequestProtocolTwo(
1709
1713
                None, server_output.write)
1710
 
            server_protocol._send_response(input_tuple)
 
1714
            server_protocol._send_response(
 
1715
                _mod_request.SuccessfulSmartServerResponse(input_tuple))
1711
1716
            self.assertEqual(expected_bytes, server_output.getvalue())
1712
1717
        # check the decoding of the client smart_protocol from expected_bytes:
1713
1718
        input = StringIO(expected_bytes)