/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 bzrlib/tests/test_info.py

  • Committer: Martin Pool
  • Date: 2007-10-03 08:06:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2901.
  • Revision ID: mbp@sourcefrog.net-20071003080644-oivy0gkg98sex0ed
Avoid internal error tracebacks on failure to lock on readonly transport (#129701).

Add new LockFailed, which doesn't imply that we failed to get it because of
contention.  Raise this if we fail to create the pending or lock directories
because of Transport errors.

UnlockableTransport is not an internal error.

ReadOnlyLockError has a message which didn't match its name or usage; it's now
deprecated and callers are updated to use LockFailed which is more appropriate.

Add zero_ninetytwo deprecation symbol.

Unify assertMatchesRe with TestCase.assertContainsRe.

When the constructor is deprecated, just say that the class is deprecated, not
the __init__ method - this works better with applyDeprecated in tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007 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
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import sys
18
17
from urllib import quote
19
18
 
20
19
from bzrlib import (
126
125
 
127
126
    def test_describe_tree_format(self):
128
127
        for key in bzrdir.format_registry.keys():
129
 
            if key in bzrdir.format_registry.aliases():
 
128
            if key == 'default':
130
129
                continue
131
130
            self.assertTreeDescription(key)
132
131
 
133
132
    def test_describe_checkout_format(self):
134
133
        for key in bzrdir.format_registry.keys():
135
 
            if key in bzrdir.format_registry.aliases():
136
 
                # Aliases will not describe correctly in the UI because the
137
 
                # real format is found.
138
 
                continue
139
 
            # legacy: weave does not support checkouts
140
 
            if key == 'weave':
141
 
                continue
142
 
            if bzrdir.format_registry.get_info(key).experimental:
143
 
                # We don't require that experimental formats support checkouts
144
 
                # or describe correctly in the UI.
145
 
                continue
146
 
            if bzrdir.format_registry.get_info(key).hidden:
 
134
            if key in ('default', 'weave', 'experimental'):
 
135
                continue
 
136
            if key.startswith('experimental-'):
 
137
                # these are typically hidden or aliases for other formats
147
138
                continue
148
139
            expected = None
149
 
            if key in ('pack-0.92',):
150
 
                expected = 'pack-0.92'
151
 
            elif key in ('knit', 'metaweave'):
 
140
            if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree'):
 
141
                expected = 'dirstate or dirstate-tags'
 
142
            if key in ('knit', 'metaweave'):
152
143
                expected = 'knit or metaweave'
153
 
            elif key in ('1.14', '1.14-rich-root'):
154
 
                expected = '1.14 or 1.14-rich-root'
155
144
            self.assertCheckoutDescription(key, expected)
156
145
 
157
146
    def test_describe_branch_format(self):
158
147
        for key in bzrdir.format_registry.keys():
159
 
            if key in bzrdir.format_registry.aliases():
160
 
                continue
161
 
            if bzrdir.format_registry.get_info(key).hidden:
 
148
            if key == 'default':
162
149
                continue
163
150
            expected = None
164
151
            if key in ('dirstate', 'knit'):
165
152
                expected = 'dirstate or knit'
166
 
            elif key in ('1.14',):
167
 
                expected = '1.14'
168
 
            elif key in ('1.14-rich-root',):
169
 
                expected = '1.14-rich-root'
170
153
            self.assertBranchDescription(key, expected)
171
154
 
172
155
    def test_describe_repo_format(self):
173
156
        for key in bzrdir.format_registry.keys():
174
 
            if key in bzrdir.format_registry.aliases():
175
 
                continue
176
 
            if bzrdir.format_registry.get_info(key).hidden:
 
157
            if key == 'default':
177
158
                continue
178
159
            expected = None
179
160
            if key in ('dirstate', 'knit', 'dirstate-tags'):
180
161
                expected = 'dirstate or dirstate-tags or knit'
181
 
            elif key in ('1.14',):
182
 
                expected = '1.14'
183
 
            elif key in ('1.14-rich-root',):
184
 
                expected = '1.14-rich-root'
185
162
            self.assertRepoDescription(key, expected)
186
163
 
187
164
        format = bzrdir.format_registry.make_bzrdir('metaweave')
271
248
        )
272
249
 
273
250
    def test_location_list(self):
274
 
        if sys.platform == 'win32':
275
 
            raise tests.TestSkipped('Windows-unfriendly test')
276
251
        locs = info.LocationList('/home/foo')
277
252
        locs.add_url('a', 'file:///home/foo/')
278
253
        locs.add_url('b', 'file:///home/foo/bar/')