~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-12 16:55:08 UTC
  • mto: This revision was merged to the branch mainline in revision 5737.
  • Revision ID: jelmer@samba.org-20110312165508-8aerwldchcf1n2ah
Test default control component format implementation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
                break
181
181
        else:
182
182
            self.fail("No NotBzrDirFormat in %s" % formats)
 
183
 
 
184
 
 
185
class UnsupportedControlComponentFormat(controldir.ControlComponentFormat):
 
186
 
 
187
    def is_supported(self):
 
188
        return False
 
189
 
 
190
 
 
191
class DefaultControlComponentFormatTests(tests.TestCase):
 
192
    """Tests for default ControlComponentFormat implementation."""
 
193
 
 
194
    def test_check_status_unsupported(self):
 
195
        self.assertRaises(errors.UnsupportedFormatError,
 
196
            UnsupportedControlComponentFormat().check_status,
 
197
            allow_unsupported=False)
 
198
        UnsupportedControlComponentFormat().check_status(
 
199
            allow_unsupported=True)
 
200
 
 
201
    def test_check_status_supported(self):
 
202
        controldir.ControlComponentFormat().check_status(
 
203
            allow_unsupported=False)
 
204
        controldir.ControlComponentFormat().check_status(
 
205
            allow_unsupported=True)