~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: Ian Clatworthy
  • Date: 2010-03-03 03:28:30 UTC
  • mto: (4797.31.1 integration-2.1)
  • mto: This revision was merged to the branch mainline in revision 5075.
  • Revision ID: ian.clatworthy@canonical.com-20100303032830-qf3ty4z40i410bem
add What's New to the list of PDF documents generated

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007-2010 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
import sys
17
18
from urllib import quote
18
19
 
19
20
from bzrlib import (
97
98
                bzrdir.format_registry.make_bzrdir(format).workingtree_format
98
99
            control.create_workingtree()
99
100
            tree = workingtree.WorkingTree.open('%s_co' % format)
100
 
            self.assertEqual(expected, info.describe_format(tree.bzrdir,
101
 
                tree.branch.repository, tree.branch, tree))
 
101
            format_description = info.describe_format(tree.bzrdir,
 
102
                    tree.branch.repository, tree.branch, tree)
 
103
            self.assertEqual(expected, format_description,
 
104
                "checkout of format called %r was described as %r" %
 
105
                (expected, format_description))
102
106
        finally:
103
107
            control._format.workingtree_format = old_format
104
108
 
122
126
 
123
127
    def test_describe_tree_format(self):
124
128
        for key in bzrdir.format_registry.keys():
125
 
            if key == 'default':
 
129
            if key in bzrdir.format_registry.aliases():
126
130
                continue
127
131
            self.assertTreeDescription(key)
128
132
 
129
133
    def test_describe_checkout_format(self):
130
134
        for key in bzrdir.format_registry.keys():
131
 
            if key in ('default', 'weave'):
 
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:
132
147
                continue
133
148
            expected = None
134
 
            if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree'):
135
 
                expected = 'dirstate or dirstate-tags'
136
 
            if key in ('knit', 'metaweave'):
 
149
            if key in ('pack-0.92',):
 
150
                expected = 'pack-0.92'
 
151
            elif key in ('knit', 'metaweave'):
137
152
                expected = 'knit or metaweave'
 
153
            elif key in ('1.14', '1.14-rich-root'):
 
154
                expected = '1.14 or 1.14-rich-root'
138
155
            self.assertCheckoutDescription(key, expected)
139
156
 
140
157
    def test_describe_branch_format(self):
141
158
        for key in bzrdir.format_registry.keys():
142
 
            if key == 'default':
 
159
            if key in bzrdir.format_registry.aliases():
 
160
                continue
 
161
            if bzrdir.format_registry.get_info(key).hidden:
143
162
                continue
144
163
            expected = None
145
164
            if key in ('dirstate', 'knit'):
146
165
                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'
147
170
            self.assertBranchDescription(key, expected)
148
171
 
149
172
    def test_describe_repo_format(self):
150
173
        for key in bzrdir.format_registry.keys():
151
 
            if key == 'default':
 
174
            if key in bzrdir.format_registry.aliases():
 
175
                continue
 
176
            if bzrdir.format_registry.get_info(key).hidden:
152
177
                continue
153
178
            expected = None
154
179
            if key in ('dirstate', 'knit', 'dirstate-tags'):
155
180
                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'
156
185
            self.assertRepoDescription(key, expected)
157
186
 
158
187
        format = bzrdir.format_registry.make_bzrdir('metaweave')
242
271
        )
243
272
 
244
273
    def test_location_list(self):
 
274
        if sys.platform == 'win32':
 
275
            raise tests.TestSkipped('Windows-unfriendly test')
245
276
        locs = info.LocationList('/home/foo')
246
277
        locs.add_url('a', 'file:///home/foo/')
247
278
        locs.add_url('b', 'file:///home/foo/bar/')