/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-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from testtools.matchers import DocTestMatches
31
31
 
32
 
import brzlib
33
 
from brzlib import (
 
32
import breezy
 
33
from breezy import (
34
34
        bzrdir,
35
35
        controldir,
36
36
        debug,
40
40
        transport as _mod_transport,
41
41
        urlutils,
42
42
        )
43
 
from brzlib.smart import (
 
43
from breezy.smart import (
44
44
        client,
45
45
        medium,
46
46
        message,
49
49
        server as _mod_server,
50
50
        vfs,
51
51
)
52
 
from brzlib.tests import (
 
52
from breezy.tests import (
53
53
    features,
54
54
    test_smart,
55
55
    test_server,
56
56
    )
57
 
from brzlib.transport import (
 
57
from breezy.transport import (
58
58
        http,
59
59
        local,
60
60
        memory,
1749
1749
        self.assertEqual(None, response.body)
1750
1750
 
1751
1751
    def test_get_bundle(self):
1752
 
        from brzlib.bundle import serializer
 
1752
        from breezy.bundle import serializer
1753
1753
        wt = self.make_branch_and_tree('.')
1754
1754
        self.build_tree_contents([('hello', 'hello world')])
1755
1755
        wt.add('hello')
1933
1933
        :returns: a Request
1934
1934
        """
1935
1935
        # This is very similar to
1936
 
        # brzlib.smart.client._SmartClient._build_client_protocol
 
1936
        # breezy.smart.client._SmartClient._build_client_protocol
1937
1937
        # XXX: make this use _SmartClient!
1938
1938
        if input_bytes is None:
1939
1939
            input = StringIO()
2898
2898
class TestConventionalResponseHandlerBodyStream(tests.TestCase):
2899
2899
 
2900
2900
    def make_response_handler(self, response_bytes):
2901
 
        from brzlib.smart.message import ConventionalResponseHandler
 
2901
        from breezy.smart.message import ConventionalResponseHandler
2902
2902
        response_handler = ConventionalResponseHandler()
2903
2903
        protocol_decoder = protocol.ProtocolThreeDecoder(response_handler)
2904
2904
        # put decoder in desired state (waiting for message parts)
2973
2973
        """Make a ConventionalRequestHandler for the given bytes using test
2974
2974
        doubles for the request_handler and the responder.
2975
2975
        """
2976
 
        from brzlib.smart.message import ConventionalRequestHandler
 
2976
        from breezy.smart.message import ConventionalRequestHandler
2977
2977
        request_handler = InstrumentedRequestHandler()
2978
2978
        request_handler.response = _mod_request.SuccessfulSmartServerResponse(('arg', 'arg'))
2979
2979
        responder = FakeResponder()
3365
3365
        encoder, out_stream = self.make_response_encoder()
3366
3366
        encoder.send_error(errors.UnknownSmartMethod('method name'))
3367
3367
        # Use assertEndsWith so that we don't compare the header, which varies
3368
 
        # by brzlib.__version__.
 
3368
        # by breezy.__version__.
3369
3369
        self.assertEndsWith(
3370
3370
            out_stream.getvalue(),
3371
3371
            # error status
3745
3745
        """
3746
3746
        smart_client = client._SmartClient('dummy medium')
3747
3747
        self.assertEqual(
3748
 
            brzlib.__version__, smart_client._headers['Software version'])
 
3748
            breezy.__version__, smart_client._headers['Software version'])
3749
3749
        # XXX: need a test that smart_client._headers is passed to the request
3750
3750
        # encoder.
3751
3751