~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.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:
228
228
        branch = _mod_branch.Branch.open('.')
229
229
        self.assertEquals(branch._format.features, {})
230
230
 
231
 
    def test_register_unregister_format(self):
232
 
        # Test the deprecated format registration functions
233
 
        format = SampleBranchFormat()
234
 
        # make a control dir
235
 
        dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
236
 
        # make a branch
237
 
        format.initialize(dir)
238
 
        # register a format for it.
239
 
        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
240
 
            _mod_branch.BranchFormat.register_format, format)
241
 
        # which branch.Open will refuse (not supported)
242
 
        self.assertRaises(errors.UnsupportedFormatError,
243
 
                          _mod_branch.Branch.open, self.get_url())
244
 
        self.make_branch_and_tree('foo')
245
 
        # but open_downlevel will work
246
 
        self.assertEqual(
247
 
            format.open(dir),
248
 
            controldir.ControlDir.open(self.get_url()).open_branch(unsupported=True))
249
 
        # unregister the format
250
 
        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
251
 
            _mod_branch.BranchFormat.unregister_format, format)
252
 
        self.make_branch_and_tree('bar')
253
 
 
254
231
 
255
232
class TestBranchFormatRegistry(tests.TestCase):
256
233
 
736
713
 
737
714
class TestPullResult(tests.TestCase):
738
715
 
739
 
    def test_pull_result_to_int(self):
740
 
        # to support old code, the pull result can be used as an int
741
 
        r = _mod_branch.PullResult()
742
 
        r.old_revno = 10
743
 
        r.new_revno = 20
744
 
        # this usage of results is not recommended for new code (because it
745
 
        # doesn't describe very well what happened), but for api stability
746
 
        # it's still supported
747
 
        self.assertEqual(self.applyDeprecated(
748
 
            symbol_versioning.deprecated_in((2, 3, 0)),
749
 
            r.__int__),
750
 
            10)
751
 
 
752
716
    def test_report_changed(self):
753
717
        r = _mod_branch.PullResult()
754
718
        r.old_revid = "old-revid"