/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: 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:
23
23
import subprocess
24
24
import sys
25
25
 
26
 
from brzlib import (
 
26
from breezy import (
27
27
    branch,
28
28
    bzrdir,
29
29
    config,
41
41
    workingtree_3,
42
42
    workingtree_4,
43
43
    )
44
 
import brzlib.branch
45
 
from brzlib.branchfmt.fullhistory import BzrBranchFormat5
46
 
from brzlib.errors import (
 
44
import breezy.branch
 
45
from breezy.branchfmt.fullhistory import BzrBranchFormat5
 
46
from breezy.errors import (
47
47
    NotBranchError,
48
48
    NoColocatedBranchSupport,
49
49
    UnknownFormatError,
50
50
    UnsupportedFormatError,
51
51
    )
52
 
from brzlib.tests import (
 
52
from breezy.tests import (
53
53
    TestCase,
54
54
    TestCaseWithMemoryTransport,
55
55
    TestCaseWithTransport,
56
56
    TestSkipped,
57
57
    )
58
 
from brzlib.tests import(
 
58
from breezy.tests import(
59
59
    http_server,
60
60
    http_utils,
61
61
    )
62
 
from brzlib.tests.test_http import TestWithTransport_pycurl
63
 
from brzlib.transport import (
 
62
from breezy.tests.test_http import TestWithTransport_pycurl
 
63
from breezy.transport import (
64
64
    memory,
65
65
    pathfilter,
66
66
    )
67
 
from brzlib.transport.http._urllib import HttpTransport_urllib
68
 
from brzlib.transport.nosmart import NoSmartTransportDecorator
69
 
from brzlib.transport.readonly import ReadonlyTransportDecorator
70
 
from brzlib.repofmt import knitrepo, knitpack_repo
 
67
from breezy.transport.http._urllib import HttpTransport_urllib
 
68
from breezy.transport.nosmart import NoSmartTransportDecorator
 
69
from breezy.transport.readonly import ReadonlyTransportDecorator
 
70
from breezy.repofmt import knitrepo, knitpack_repo
71
71
 
72
72
 
73
73
class TestDefaultFormat(TestCase):
97
97
        my_format_registry.register('deprecated', DeprecatedBzrDirFormat,
98
98
            'Some format.  Slower and unawesome and deprecated.',
99
99
            deprecated=True)
100
 
        my_format_registry.register_lazy('lazy', 'brzlib.tests.test_bzrdir',
 
100
        my_format_registry.register_lazy('lazy', 'breezy.tests.test_bzrdir',
101
101
            'DeprecatedBzrDirFormat', 'Format registered lazily',
102
102
            deprecated=True)
103
103
        bzrdir.register_metadir(my_format_registry, 'knit',
104
 
            'brzlib.repofmt.knitrepo.RepositoryFormatKnit1',
 
104
            'breezy.repofmt.knitrepo.RepositoryFormatKnit1',
105
105
            'Format using knits',
106
106
            )
107
107
        my_format_registry.set_default('knit')
108
108
        bzrdir.register_metadir(my_format_registry,
109
109
            'branch6',
110
 
            'brzlib.repofmt.knitrepo.RepositoryFormatKnit3',
 
110
            'breezy.repofmt.knitrepo.RepositoryFormatKnit3',
111
111
            'Experimental successor to knit.  Use at your own risk.',
112
 
            branch_format='brzlib.branch.BzrBranchFormat6',
 
112
            branch_format='breezy.branch.BzrBranchFormat6',
113
113
            experimental=True)
114
114
        bzrdir.register_metadir(my_format_registry,
115
115
            'hidden format',
116
 
            'brzlib.repofmt.knitrepo.RepositoryFormatKnit3',
 
116
            'breezy.repofmt.knitrepo.RepositoryFormatKnit3',
117
117
            'Experimental successor to knit.  Use at your own risk.',
118
 
            branch_format='brzlib.branch.BzrBranchFormat6', hidden=True)
 
118
            branch_format='breezy.branch.BzrBranchFormat6', hidden=True)
119
119
        my_format_registry.register('hiddendeprecated', DeprecatedBzrDirFormat,
120
120
            'Old format.  Slower and does not support things. ', hidden=True)
121
 
        my_format_registry.register_lazy('hiddenlazy', 'brzlib.tests.test_bzrdir',
 
121
        my_format_registry.register_lazy('hiddenlazy', 'breezy.tests.test_bzrdir',
122
122
            'DeprecatedBzrDirFormat', 'Format registered lazily',
123
123
            deprecated=True, hidden=True)
124
124
        return my_format_registry
137
137
            knitrepo.RepositoryFormatKnit1)
138
138
        my_bzrdir = my_format_registry.make_bzrdir('branch6')
139
139
        self.assertIsInstance(my_bzrdir.get_branch_format(),
140
 
                              brzlib.branch.BzrBranchFormat6)
 
140
                              breezy.branch.BzrBranchFormat6)
141
141
 
142
142
    def test_get_help(self):
143
143
        my_format_registry = self.make_format_registry()
194
194
        self.assertEqual(frozenset(['deprecatedalias']), a_registry.aliases())
195
195
 
196
196
 
197
 
class SampleBranch(brzlib.branch.Branch):
 
197
class SampleBranch(breezy.branch.Branch):
198
198
    """A dummy branch for guess what, dummy use."""
199
199
 
200
200
    def __init__(self, dir):
201
201
        self.bzrdir = dir
202
202
 
203
203
 
204
 
class SampleRepository(brzlib.repository.Repository):
 
204
class SampleRepository(breezy.repository.Repository):
205
205
    """A dummy repo."""
206
206
 
207
207
    def __init__(self, dir):
508
508
        # Make stackable source branch with an unstackable repo format.
509
509
        source_bzrdir = self.make_bzrdir('source')
510
510
        knitpack_repo.RepositoryFormatKnitPack1().initialize(source_bzrdir)
511
 
        source_branch = brzlib.branch.BzrBranchFormat7().initialize(
 
511
        source_branch = breezy.branch.BzrBranchFormat7().initialize(
512
512
            source_bzrdir)
513
513
        # Make a directory with a default stacking policy
514
514
        parent_bzrdir = self.make_bzrdir('parent')
1267
1267
        return _TestBzrDirFormat()
1268
1268
 
1269
1269
 
1270
 
class _TestBranchFormat(brzlib.branch.BranchFormat):
 
1270
class _TestBranchFormat(breezy.branch.BranchFormat):
1271
1271
    """Test Branch format for TestBzrDirSprout."""
1272
1272
 
1273
1273
 
1274
 
class _TestBranch(brzlib.branch.Branch):
 
1274
class _TestBranch(breezy.branch.Branch):
1275
1275
    """Test Branch implementation for TestBzrDirSprout."""
1276
1276
 
1277
1277
    def __init__(self, transport, *args, **kwargs):
1371
1371
        self.assertEqual('fail', err._preformatted_string)
1372
1372
 
1373
1373
    def test_post_repo_init(self):
1374
 
        from brzlib.controldir import RepoInitHookParams
 
1374
        from breezy.controldir import RepoInitHookParams
1375
1375
        calls = []
1376
1376
        bzrdir.BzrDir.hooks.install_named_hook('post_repo_init',
1377
1377
            calls.append, None)