~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: 2011-12-22 18:52:58 UTC
  • mfrom: (6213.1.55 feature-flags)
  • Revision ID: pqm@pqm.ubuntu.com-20111222185258-wgcba8590pbw5sf1
(jelmer) Add support for feature flags in bzr formats. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
        self.assertIsInstance(
202
202
            SampleBranchFormat.from_string("Sample branch format."),
203
203
            SampleBranchFormat)
204
 
        self.assertRaises(ValueError,
 
204
        self.assertRaises(AssertionError,
205
205
            SampleBranchFormat.from_string, "Different branch format.")
206
206
 
207
207
    def test_find_format_not_branch(self):
217
217
                          _mod_branch.BranchFormatMetadir.find_format,
218
218
                          dir)
219
219
 
 
220
    def test_find_format_with_features(self):
 
221
        tree = self.make_branch_and_tree('.', format='2a')
 
222
        tree.branch.control_transport.put_bytes('format',
 
223
            tree.branch._format.get_format_string() +
 
224
            "optional name\n")
 
225
        found_format = _mod_branch.BranchFormatMetadir.find_format(tree.bzrdir)
 
226
        self.assertIsInstance(found_format, _mod_branch.BranchFormatMetadir)
 
227
        self.assertEquals(found_format.features.get("name"), "optional")
 
228
 
220
229
    def test_register_unregister_format(self):
221
230
        # Test the deprecated format registration functions
222
231
        format = SampleBranchFormat()
718
727
        f = StringIO()
719
728
        r.report(f)
720
729
        self.assertEqual("No revisions or tags to pull.\n", f.getvalue())
721