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

  • Committer: Jelmer Vernooij
  • Date: 2020-03-22 20:02:36 UTC
  • mto: (7490.7.7 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200322200236-fsbl91ktcn6fcbdd
Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import base64
27
27
import bz2
28
 
from io import BytesIO
29
28
import tarfile
30
29
import zlib
31
30
 
32
 
from ... import (
 
31
from .. import (
33
32
    bencode,
34
33
    branch,
35
34
    config,
40
39
    transport,
41
40
    treebuilder,
42
41
    )
43
 
from ...branch import Branch
44
 
from .. import (
 
42
from ..branch import Branch
 
43
from ..bzr import (
45
44
    bzrdir,
46
45
    inventory,
47
46
    inventory_delta,
49
48
    versionedfile,
50
49
    vf_search,
51
50
    )
52
 
from ..bzrdir import (
 
51
from ..bzr.bzrdir import (
53
52
    BzrDir,
54
53
    BzrDirFormat,
55
54
    )
56
 
from .. import (
 
55
from ..bzr import (
57
56
    RemoteBzrProber,
58
57
    )
59
 
from ..chk_serializer import chk_bencode_serializer
60
 
from ..remote import (
 
58
from ..bzr.chk_serializer import chk_bencode_serializer
 
59
from ..bzr.remote import (
61
60
    RemoteBranch,
62
61
    RemoteBranchFormat,
63
62
    RemoteBzrDir,
65
64
    RemoteRepository,
66
65
    RemoteRepositoryFormat,
67
66
    )
68
 
from .. import groupcompress_repo, knitpack_repo
69
 
from ...revision import (
 
67
from ..bzr import groupcompress_repo, knitpack_repo
 
68
from ..revision import (
70
69
    NULL_REVISION,
71
70
    Revision,
72
71
    )
73
 
from ..smart import medium, request
74
 
from ..smart.client import _SmartClient
75
 
from ..smart.repository import (
 
72
from ..sixish import (
 
73
    BytesIO,
 
74
    PY3,
 
75
    text_type,
 
76
    )
 
77
from ..bzr.smart import medium, request
 
78
from ..bzr.smart.client import _SmartClient
 
79
from ..bzr.smart.repository import (
76
80
    SmartServerRepositoryGetParentMap,
77
81
    SmartServerRepositoryGetStream_1_19,
78
82
    _stream_to_byte_stream,
79
83
    )
80
 
from ...tests import (
 
84
from . import (
81
85
    test_server,
82
86
    )
83
 
from ...tests.scenarios import load_tests_apply_scenarios
84
 
from ...transport.memory import MemoryTransport
85
 
from ...transport.remote import (
 
87
from .scenarios import load_tests_apply_scenarios
 
88
from ..transport.memory import MemoryTransport
 
89
from ..transport.remote import (
86
90
    RemoteTransport,
87
91
    RemoteSSHTransport,
88
92
    RemoteTCPTransport,
335
339
        client.add_success_response(b'yes',)
336
340
        transport = RemoteTransport('bzr://localhost/', _client=client)
337
341
        filename = u'/hell\u00d8'
338
 
        result = transport.has(filename)
 
342
        if PY3:
 
343
            result = transport.has(filename)
 
344
        else:
 
345
            result = transport.has(filename.encode('utf-8'))
339
346
        self.assertEqual(
340
347
            [('call', b'has', (filename.encode('utf-8'),))],
341
348
            client._calls)
1780
1787
            branch._set_last_revision, b'rev-id')
1781
1788
        # The UTF-8 message from the response has been decoded into a unicode
1782
1789
        # object.
1783
 
        self.assertIsInstance(err.msg, str)
 
1790
        self.assertIsInstance(err.msg, text_type)
1784
1791
        self.assertEqual(rejection_msg_unicode, err.msg)
1785
1792
        branch.unlock()
1786
1793
        self.assertFinished(client)