~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-14 14:39:16 UTC
  • mfrom: (6027.1.18 deprecations)
  • Revision ID: pqm@pqm.ubuntu.com-20120314143916-dggf9d1d26j3kizq
(vila) Remove some code deprecated in series older than 2.4 (inclusive)
 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
                          workingtree.WorkingTreeFormatMetaDir.find_format,
219
219
                          dir)
220
220
 
221
 
    def test_register_unregister_format(self):
222
 
        format = SampleTreeFormat()
223
 
        # make a control dir
224
 
        dir = bzrdir.BzrDirMetaFormat1().initialize('.')
225
 
        dir.create_repository()
226
 
        dir.create_branch()
227
 
        # make a branch
228
 
        format.initialize(dir)
229
 
        # register a format for it.
230
 
        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
231
 
            workingtree.WorkingTreeFormat.register_format, format)
232
 
        self.assertTrue(format in 
233
 
            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
234
 
                workingtree.WorkingTreeFormat.get_formats))
235
 
        # which branch.Open will refuse (not supported)
236
 
        self.assertRaises(errors.UnsupportedFormatError, workingtree.WorkingTree.open, '.')
237
 
        # but open_downlevel will work
238
 
        self.assertEqual(format.open(dir), workingtree.WorkingTree.open_downlevel('.'))
239
 
        # unregister the format
240
 
        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
241
 
            workingtree.WorkingTreeFormat.unregister_format, format)
242
 
        self.assertFalse(format in
243
 
            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
244
 
                workingtree.WorkingTreeFormat.get_formats))
245
 
 
246
221
    def test_find_format_with_features(self):
247
222
        tree = self.make_branch_and_tree('.', format='2a')
248
223
        tree.update_feature_flags({"name": "necessity"})