~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: Robert Collins
  • Date: 2007-08-06 23:49:18 UTC
  • mto: (2592.3.81 repository)
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: robertc@robertcollins.net-20070806234918-xc9w5f86tgjphf9u
Prevent the duplicate additions of names to FileNames collections.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 (
98
97
                bzrdir.format_registry.make_bzrdir(format).workingtree_format
99
98
            control.create_workingtree()
100
99
            tree = workingtree.WorkingTree.open('%s_co' % format)
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))
 
100
            self.assertEqual(expected, info.describe_format(tree.bzrdir,
 
101
                tree.branch.repository, tree.branch, tree))
106
102
        finally:
107
103
            control._format.workingtree_format = old_format
108
104
 
126
122
 
127
123
    def test_describe_tree_format(self):
128
124
        for key in bzrdir.format_registry.keys():
129
 
            if key in bzrdir.format_registry.aliases():
 
125
            if key == 'default':
130
126
                continue
131
127
            self.assertTreeDescription(key)
132
128
 
133
129
    def test_describe_checkout_format(self):
134
130
        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.
 
131
            if key in ('default', 'weave'):
145
132
                continue
146
133
            expected = None
147
 
            if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
148
 
                'pack-0.92', 'pack-0.92-subtree', 'rich-root',
149
 
                'rich-root-pack', '1.6', '1.6.1-rich-root',
150
 
                '1.9', '1.9-rich-root'):
151
 
                expected = '1.6 or 1.6.1-rich-root or ' \
152
 
                    '1.9 or 1.9-rich-root or ' \
153
 
                    'dirstate or dirstate-tags or pack-0.92 or'\
154
 
                    ' rich-root or rich-root-pack'
155
 
            elif key in ('knit', 'metaweave'):
 
134
            if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree'):
 
135
                expected = 'dirstate or dirstate-tags'
 
136
            if key in ('knit', 'metaweave'):
156
137
                expected = 'knit or metaweave'
157
 
            elif key in ('1.14', '1.14-rich-root'):
158
 
                expected = '1.14 or 1.14-rich-root'
159
138
            self.assertCheckoutDescription(key, expected)
160
139
 
161
140
    def test_describe_branch_format(self):
162
141
        for key in bzrdir.format_registry.keys():
163
 
            if key in bzrdir.format_registry.aliases():
164
 
                continue
165
 
            if bzrdir.format_registry.get_info(key).hidden:
 
142
            if key == 'default':
166
143
                continue
167
144
            expected = None
168
145
            if key in ('dirstate', 'knit'):
169
146
                expected = 'dirstate or knit'
170
 
            elif key in ('1.9', '1.14'):
171
 
                expected = '1.14 or 1.9'
172
 
            elif key in ('1.9-rich-root', '1.14-rich-root'):
173
 
                expected = '1.14-rich-root or 1.9-rich-root'
174
147
            self.assertBranchDescription(key, expected)
175
148
 
176
149
    def test_describe_repo_format(self):
177
150
        for key in bzrdir.format_registry.keys():
178
 
            if key in bzrdir.format_registry.aliases():
179
 
                continue
180
 
            if bzrdir.format_registry.get_info(key).hidden:
 
151
            if key == 'default':
181
152
                continue
182
153
            expected = None
183
154
            if key in ('dirstate', 'knit', 'dirstate-tags'):
184
155
                expected = 'dirstate or dirstate-tags or knit'
185
 
            elif key in ('1.9', '1.14'):
186
 
                expected = '1.14 or 1.9'
187
 
            elif key in ('1.9-rich-root', '1.14-rich-root'):
188
 
                expected = '1.14-rich-root or 1.9-rich-root'
189
156
            self.assertRepoDescription(key, expected)
190
157
 
191
158
        format = bzrdir.format_registry.make_bzrdir('metaweave')
275
242
        )
276
243
 
277
244
    def test_location_list(self):
278
 
        if sys.platform == 'win32':
279
 
            raise tests.TestSkipped('Windows-unfriendly test')
280
245
        locs = info.LocationList('/home/foo')
281
246
        locs.add_url('a', 'file:///home/foo/')
282
247
        locs.add_url('b', 'file:///home/foo/bar/')