~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-25 15:55:48 UTC
  • mto: (4985.1.4 add-attr-cleanup)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125155548-0l352pujvt5bzl5e
Deploy addAttrCleanup on the whole test suite.

Several use case worth mentioning:

- setting a module or any other object attribute is the majority
by far. In some cases the setting itself is deferred but most of
the time we want to set at the same time we add the cleanup.

- there multiple occurrences of protecting hooks or ui factory
which are now useless (the test framework takes care of that now),

- there was some lambda uses that can now be avoided.

That first cleanup already simplifies things a lot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
                # We don't require that experimental formats support checkouts
144
144
                # or describe correctly in the UI.
145
145
                continue
 
146
            if bzrdir.format_registry.get_info(key).hidden:
 
147
                continue
146
148
            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'
 
149
            if key in ('pack-0.92',):
 
150
                expected = 'pack-0.92'
155
151
            elif key in ('knit', 'metaweave'):
156
152
                expected = 'knit or metaweave'
157
153
            elif key in ('1.14', '1.14-rich-root'):
167
163
            expected = None
168
164
            if key in ('dirstate', 'knit'):
169
165
                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'
 
166
            elif key in ('1.14',):
 
167
                expected = '1.14'
 
168
            elif key in ('1.14-rich-root',):
 
169
                expected = '1.14-rich-root'
174
170
            self.assertBranchDescription(key, expected)
175
171
 
176
172
    def test_describe_repo_format(self):
182
178
            expected = None
183
179
            if key in ('dirstate', 'knit', 'dirstate-tags'):
184
180
                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'
 
181
            elif key in ('1.14',):
 
182
                expected = '1.14'
 
183
            elif key in ('1.14-rich-root',):
 
184
                expected = '1.14-rich-root'
189
185
            self.assertRepoDescription(key, expected)
190
186
 
191
187
        format = bzrdir.format_registry.make_bzrdir('metaweave')