~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_controldir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-11 14:14:37 UTC
  • mto: (5712.4.8 bzrdir-weave)
  • mto: This revision was merged to the branch mainline in revision 5716.
  • Revision ID: jelmer@samba.org-20110311141437-leo1i31d6zfrqb8r
Raise exception from ControlDirFormat.register_format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
        self.assertIsInstance(formats[0], SampleExtraComponentFormat)
85
85
 
86
86
 
87
 
class ControlDirFormatTest1(controldir.ControlDirFormat):
88
 
    """A test control dir format."""
89
 
 
90
 
 
91
 
class TestControlDirFormat(tests.TestCaseWithTransport):
92
 
    """Tests for the ControlDirFormat facility."""
93
 
 
94
 
    def test_register_unregister_format(self):
95
 
        format = ControlDirFormatTest1()
96
 
        controldir.ControlDirFormat.register_format("myformat", format)
97
 
        self.assertTrue(format in controldir.ControlDirFormat.known_formats())
98
 
        controldir.ControlDirFormat.unregister_format("myformat")
99
 
        self.assertFalse(format in controldir.ControlDirFormat.known_formats())
100
 
        self.assertRaises(KeyError,
101
 
            controldir.ControlDirFormat.unregister_format, "myformat")
 
87
class TestControlDirFormatDeprecated(tests.TestCaseWithTransport):
 
88
    """Tests for removed registration method in the ControlDirFormat facility."""
 
89
 
 
90
    def test_register_format(self):
 
91
        self.assertRaises(errors.BzrError,
 
92
            controldir.ControlDirFormat.register_format, object())
102
93
 
103
94
 
104
95
class TestProber(tests.TestCaseWithTransport):