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

  • Committer: Jelmer Vernooij
  • Date: 2018-03-24 17:48:04 UTC
  • mfrom: (6921 work)
  • mto: This revision was merged to the branch mainline in revision 6923.
  • Revision ID: jelmer@jelmer.uk-20180324174804-xf22o05byoj12x1q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    memory,
69
69
    pathfilter,
70
70
    )
71
 
from ..transport.http import HttpTransport
 
71
from ..transport.http._urllib import HttpTransport_urllib
72
72
from ..transport.nosmart import NoSmartTransportDecorator
73
73
from ..transport.readonly import ReadonlyTransportDecorator
74
74
from ..bzr import knitrepo, knitpack_repo
192
192
        a_registry.register('deprecated', DeprecatedBzrDirFormat,
193
193
            'Old format.  Slower and does not support stuff',
194
194
            deprecated=True)
195
 
        a_registry.register_alias('deprecatedalias', 'deprecated')
196
 
        self.assertEqual({'deprecatedalias': 'deprecated'},
197
 
                         a_registry.aliases())
 
195
        a_registry.register('deprecatedalias', DeprecatedBzrDirFormat,
 
196
            'Old format.  Slower and does not support stuff',
 
197
            deprecated=True, alias=True)
 
198
        self.assertEqual(frozenset(['deprecatedalias']), a_registry.aliases())
198
199
 
199
200
 
200
201
class SampleBranch(breezy.branch.Branch):
830
831
                                         format='development-subtree')
831
832
        sub_tree = self.make_branch_and_tree('tree1/subtree',
832
833
            format='development-subtree')
833
 
        sub_tree.set_root_id(b'subtree-root')
 
834
        sub_tree.set_root_id('subtree-root')
834
835
        tree.add_reference(sub_tree)
835
836
        self.build_tree(['tree1/subtree/file'])
836
837
        sub_tree.add('file')
1117
1118
                              workingtree_4.WorkingTreeFormat4)
1118
1119
 
1119
1120
 
1120
 
class TestHTTPRedirectionsBase(object):
 
1121
class TestHTTPRedirections(object):
1121
1122
    """Test redirection between two http servers.
1122
1123
 
1123
1124
    This MUST be used by daughter classes that also inherit from
1137
1138
        return http_utils.HTTPServerRedirecting()
1138
1139
 
1139
1140
    def setUp(self):
1140
 
        super(TestHTTPRedirectionsBase, self).setUp()
 
1141
        super(TestHTTPRedirections, self).setUp()
1141
1142
        # The redirections will point to the new server
1142
1143
        self.new_server = self.get_readonly_server()
1143
1144
        # The requests to the old server will be redirected
1171
1172
        self.assertIsInstance(bdir.root_transport, type(start))
1172
1173
 
1173
1174
 
1174
 
class TestHTTPRedirections(TestHTTPRedirectionsBase,
1175
 
                           http_utils.TestCaseWithTwoWebservers):
 
1175
class TestHTTPRedirections_urllib(TestHTTPRedirections,
 
1176
                                  http_utils.TestCaseWithTwoWebservers):
1176
1177
    """Tests redirections for urllib implementation"""
1177
1178
 
1178
 
    _transport = HttpTransport
 
1179
    _transport = HttpTransport_urllib
1179
1180
 
1180
1181
    def _qualified_url(self, host, port):
1181
 
        result = 'http://%s:%s' % (host, port)
 
1182
        result = 'http+urllib://%s:%s' % (host, port)
1182
1183
        self.permit_url(result)
1183
1184
        return result
1184
1185
 
1185
1186
 
1186
1187
 
1187
 
class TestHTTPRedirections_nosmart(TestHTTPRedirectionsBase,
 
1188
class TestHTTPRedirections_nosmart(TestHTTPRedirections,
1188
1189
                                  http_utils.TestCaseWithTwoWebservers):
1189
1190
    """Tests redirections for the nosmart decorator"""
1190
1191
 
1196
1197
        return result
1197
1198
 
1198
1199
 
1199
 
class TestHTTPRedirections_readonly(TestHTTPRedirectionsBase,
 
1200
class TestHTTPRedirections_readonly(TestHTTPRedirections,
1200
1201
                                    http_utils.TestCaseWithTwoWebservers):
1201
1202
    """Tests redirections for readonly decoratror"""
1202
1203