~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: 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:
83
83
        self.assertIsInstance(
84
84
            SampleTreeFormat.from_string("Sample tree format."),
85
85
            SampleTreeFormat)
86
 
        self.assertRaises(ValueError,
 
86
        self.assertRaises(AssertionError,
87
87
            SampleTreeFormat.from_string, "Different format string.")
88
88
 
89
89
    def test_get_set_default_format_by_key(self):
243
243
            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
244
244
                workingtree.WorkingTreeFormat.get_formats))
245
245
 
 
246
    def test_find_format_with_features(self):
 
247
        tree = self.make_branch_and_tree('.', format='2a')
 
248
        tree.control_transport.put_bytes('format',
 
249
            tree._format.get_format_string() + "necessity name\n")
 
250
        found_format = workingtree.WorkingTreeFormatMetaDir.find_format(
 
251
            tree.bzrdir)
 
252
        self.assertIsInstance(found_format, workingtree.WorkingTreeFormat)
 
253
        self.assertEquals(found_format.features.get("name"), "necessity")
 
254
        self.assertRaises(errors.MissingFeature, found_format.check_support_status,
 
255
            True)
 
256
        self.addCleanup(workingtree.WorkingTreeFormatMetaDir.unregister_feature,
 
257
            "name")
 
258
        workingtree.WorkingTreeFormatMetaDir.register_feature("name")
 
259
        found_format.check_support_status(True)
 
260
 
246
261
 
247
262
class TestWorkingTreeIterEntriesByDir_wSubtrees(TestCaseWithTransport):
248
263