47
from brzlib.branch import Branch
48
from brzlib.bzrdir import (
47
from breezy.branch import Branch
48
from breezy.bzrdir import (
53
from brzlib.chk_serializer import chk_bencode_serializer
54
from brzlib.remote import (
53
from breezy.chk_serializer import chk_bencode_serializer
54
from breezy.remote import (
56
56
RemoteBranchFormat,
60
60
RemoteRepositoryFormat,
62
from brzlib.repofmt import groupcompress_repo, knitpack_repo
63
from brzlib.revision import (
62
from breezy.repofmt import groupcompress_repo, knitpack_repo
63
from breezy.revision import (
67
from brzlib.smart import medium, request
68
from brzlib.smart.client import _SmartClient
69
from brzlib.smart.repository import (
67
from breezy.smart import medium, request
68
from breezy.smart.client import _SmartClient
69
from breezy.smart.repository import (
70
70
SmartServerRepositoryGetParentMap,
71
71
SmartServerRepositoryGetStream_1_19,
72
72
_stream_to_byte_stream,
74
from brzlib.symbol_versioning import deprecated_in
75
from brzlib.tests import (
74
from breezy.symbol_versioning import deprecated_in
75
from breezy.tests import (
78
from brzlib.tests.scenarios import load_tests_apply_scenarios
79
from brzlib.transport.memory import MemoryTransport
80
from brzlib.transport.remote import (
78
from breezy.tests.scenarios import load_tests_apply_scenarios
79
from breezy.transport.memory import MemoryTransport
80
from breezy.transport.remote import (
82
82
RemoteSSHTransport,
83
83
RemoteTCPTransport,
3604
3604
class TestErrorTranslationBase(tests.TestCaseWithMemoryTransport):
3605
"""Base class for unit tests for brzlib.remote._translate_error."""
3605
"""Base class for unit tests for breezy.remote._translate_error."""
3607
3607
def translateTuple(self, error_tuple, **context):
3608
3608
"""Call _translate_error with an ErrorFromSmartServer built from the
3638
3638
class TestErrorTranslationSuccess(TestErrorTranslationBase):
3639
"""Unit tests for brzlib.remote._translate_error.
3639
"""Unit tests for breezy.remote._translate_error.
3641
3641
Given an ErrorFromSmartServer (which has an error tuple from a smart
3642
3642
server) and some context, _translate_error raises more specific errors from
3645
3645
This test case covers the cases where _translate_error succeeds in
3646
3646
translating an ErrorFromSmartServer to something better. See
3818
3818
class TestErrorTranslationRobustness(TestErrorTranslationBase):
3819
"""Unit tests for brzlib.remote._translate_error's robustness.
3819
"""Unit tests for breezy.remote._translate_error's robustness.
3821
3821
TestErrorTranslationSuccess is for cases where _translate_error can
3822
3822
translate successfully. This class about how _translate_err behaves when