~bzr-pqm/bzr/2.3

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-28 00:42:46 UTC
  • mfrom: (5665.1.2 2.3-feature-flags)
  • Revision ID: pqm@pqm.ubuntu.com-20120328004246-kx0vzifaqi142b8i
(jelmer) Add basic support for feature flags. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1457
1457
    def test_exiting(self):
1458
1458
        self._transport.put_bytes("a.~1~", "some content")
1459
1459
        self.assertEqual("a.~2~", self._bzrdir._available_backup_name("a"))
 
1460
 
 
1461
 
 
1462
class ExtractFormatStringTests(TestCase):
 
1463
 
 
1464
    def test_normal(self):
 
1465
        self.assertEquals("Bazaar-NG branch, format 0.0.4\n",
 
1466
            bzrdir.extract_format_string("Bazaar-NG branch, format 0.0.4\n"))
 
1467
 
 
1468
    def test_with_optional_feature(self):
 
1469
        self.assertEquals("Bazaar-NG branch, format 0.0.4\n",
 
1470
            bzrdir.extract_format_string("Bazaar-NG branch, format 0.0.4\n"
 
1471
                                         "optional feature foo\n"))
 
1472
 
 
1473
    def test_with_required_feature(self):
 
1474
        self.assertRaises(errors.MissingFeature,
 
1475
            bzrdir.extract_format_string, "Bazaar-NG branch, format 0.0.4\n"
 
1476
                                          "required feature foo\n")
 
1477
 
 
1478
    def test_with_invalid_line(self):
 
1479
        self.assertRaises(errors.ParseFormatError,
 
1480
            bzrdir.extract_format_string, "Bazaar-NG branch, format 0.0.4\n"
 
1481
                                          "requiredfoo\n")