~bzr-pqm/bzr/2.2

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-28 01:54:43 UTC
  • mfrom: (4797.85.12 2.2-feature-flags)
  • Revision ID: pqm@pqm.ubuntu.com-20120328015443-eyed372ro7kc7yl6
(jelmer) Add basic support for feature flags. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1411
1411
        param_repr = param_reprs[0]
1412
1412
        self.assertStartsWith(param_repr, '<RepoInitHookParams for ')
1413
1413
 
 
1414
 
 
1415
class ExtractFormatStringTests(TestCase):
 
1416
 
 
1417
    def test_normal(self):
 
1418
        self.assertEquals("Bazaar-NG branch, format 0.0.4\n",
 
1419
            bzrdir.extract_format_string("Bazaar-NG branch, format 0.0.4\n"))
 
1420
 
 
1421
    def test_with_optional_feature(self):
 
1422
        self.assertEquals("Bazaar-NG branch, format 0.0.4\n",
 
1423
            bzrdir.extract_format_string("Bazaar-NG branch, format 0.0.4\n"
 
1424
                                         "optional feature foo\n"))
 
1425
 
 
1426
    def test_with_required_feature(self):
 
1427
        self.assertRaises(errors.MissingFeature,
 
1428
            bzrdir.extract_format_string, "Bazaar-NG branch, format 0.0.4\n"
 
1429
                                          "required feature foo\n")
 
1430
 
 
1431
    def test_with_invalid_line(self):
 
1432
        self.assertRaises(errors.ParseFormatError,
 
1433
            bzrdir.extract_format_string, "Bazaar-NG branch, format 0.0.4\n"
 
1434
                                          "requiredfoo\n")