/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_controldir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-10 13:29:54 UTC
  • mfrom: (5712.4.3 bzrdir-weave)
  • mto: This revision was merged to the branch mainline in revision 5718.
  • Revision ID: jelmer@samba.org-20110310132954-lgdypdwpu99vyv0q
Merge weave-bzrdir branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
        formats = self.registry._get_all()
78
78
        self.assertEquals(1, len(formats))
79
79
        self.assertIsInstance(formats[0], SampleExtraComponentFormat)
 
80
 
 
81
 
 
82
class ControlDirFormatTest1(controldir.ControlDirFormat):
 
83
    """A test control dir format."""
 
84
 
 
85
 
 
86
class TestControlDirFormat(tests.TestCaseWithTransport):
 
87
    """Tests for the ControlDirFormat facility."""
 
88
 
 
89
    def test_register_unregister_format(self):
 
90
        format = ControlDirFormatTest1()
 
91
        controldir.ControlDirFormat.register_format(format)
 
92
        self.assertTrue(format in controldir.ControlDirFormat.known_formats())
 
93
        controldir.ControlDirFormat.unregister_format(format)
 
94
        self.assertFalse(format in controldir.ControlDirFormat.known_formats())
 
95
 
 
96
    def test_register_unregister_format_lazy(self):
 
97
        controldir.ControlDirFormat.register_lazy_format(
 
98
            "bzrlib.tests.test_controldir", "ControlDirFormatTest1")
 
99
        self.assertTrue(
 
100
            ControlDirFormatTest1 in
 
101
            controldir.ControlDirFormat.known_formats())
 
102
        controldir.ControlDirFormat.unregister_lazy_format(
 
103
            "bzrlib.tests.test_controldir", "ControlDirFormatTest1")
 
104
        self.assertFalse(
 
105
            ControlDirFormatTest1 in
 
106
            controldir.ControlDirFormat.known_formats())