~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_pack_repository.py

  • Committer: Patch Queue Manager
  • Date: 2016-01-31 13:36:59 UTC
  • mfrom: (6613.1.5 1538480-match-hostname)
  • Revision ID: pqm@pqm.ubuntu.com-20160131133659-ouy92ee2wlv9xz8m
(vila) Use ssl.match_hostname instead of our own. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
These tests are repeated for all pack-based repository formats.
20
20
"""
21
21
 
22
 
from cStringIO import StringIO
23
22
from stat import S_ISDIR
24
23
 
25
24
from bzrlib.btree_index import BTreeGraphIndex
26
25
from bzrlib.index import GraphIndex
27
26
from bzrlib import (
28
 
    bzrdir,
 
27
    controldir,
29
28
    errors,
30
29
    inventory,
31
30
    osutils,
32
 
    progress,
33
31
    repository,
34
32
    revision as _mod_revision,
35
 
    symbol_versioning,
36
33
    tests,
 
34
    transport,
37
35
    ui,
38
 
    upgrade,
39
 
    workingtree,
40
 
    )
41
 
from bzrlib.repofmt import (
42
 
    pack_repo,
43
 
    groupcompress_repo,
44
36
    )
45
37
from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2a
46
38
from bzrlib.smart import (
47
39
    client,
48
40
    )
49
41
from bzrlib.tests import (
50
 
    TestCase,
51
42
    TestCaseWithTransport,
52
43
    TestNotApplicable,
53
 
    TestSkipped,
54
44
    )
55
45
from bzrlib.transport import (
56
 
    get_transport,
57
46
    memory,
58
47
    )
59
48
from bzrlib.tests import test_server
60
 
from bzrlib.tests.per_repository import TestCaseWithRepository
61
49
 
62
50
 
63
51
class TestPackRepository(TestCaseWithTransport):
71
59
    """
72
60
 
73
61
    def get_format(self):
74
 
        return bzrdir.format_registry.make_bzrdir(self.format_name)
 
62
        return controldir.format_registry.make_bzrdir(self.format_name)
75
63
 
76
64
    def test_attribute__fetch_order(self):
77
65
        """Packs do not need ordered data retrieval."""
278
266
        format = self.get_format()
279
267
        server = test_server.FakeNFSServer()
280
268
        self.start_server(server)
281
 
        transport = get_transport(server.get_url())
282
 
        bzrdir = self.get_format().initialize_on_transport(transport)
 
269
        t = transport.get_transport_from_url(server.get_url())
 
270
        bzrdir = self.get_format().initialize_on_transport(t)
283
271
        repo = bzrdir.create_repository()
284
272
        repo_transport = bzrdir.get_repository_transport(None)
285
273
        self.assertTrue(repo_transport.has('obsolete_packs'))
881
869
        super(TestPackRepositoryStacking, self).setUp()
882
870
 
883
871
    def get_format(self):
884
 
        return bzrdir.format_registry.make_bzrdir(self.format_name)
 
872
        return controldir.format_registry.make_bzrdir(self.format_name)
885
873
 
886
874
    def test_stack_checks_rich_root_compatibility(self):
887
875
        # early versions of the packing code relied on pack internals to
1012
1000
class TestKeyDependencies(TestCaseWithTransport):
1013
1001
 
1014
1002
    def get_format(self):
1015
 
        return bzrdir.format_registry.make_bzrdir(self.format_name)
 
1003
        return controldir.format_registry.make_bzrdir(self.format_name)
1016
1004
 
1017
1005
    def create_source_and_target(self):
1018
1006
        builder = self.make_branch_builder('source', format=self.get_format())
1097
1085
        self.hpss_calls.append(params.method)
1098
1086
 
1099
1087
    def get_format(self):
1100
 
        return bzrdir.format_registry.make_bzrdir(self.format_name)
 
1088
        return controldir.format_registry.make_bzrdir(self.format_name)
1101
1089
 
1102
1090
    def test_autopack_or_streaming_rpc_is_used_when_using_hpss(self):
1103
1091
        # Make local and remote repos
1105
1093
        tree = self.make_branch_and_tree('local', format=format)
1106
1094
        self.make_branch_and_tree('remote', format=format)
1107
1095
        remote_branch_url = self.smart_server.get_url() + 'remote'
1108
 
        remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch()
 
1096
        remote_branch = controldir.ControlDir.open(remote_branch_url).open_branch()
1109
1097
        # Make 9 local revisions, and push them one at a time to the remote
1110
1098
        # repo to produce 9 pack files.
1111
1099
        for x in range(9):