~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-14 18:32:19 UTC
  • mto: This revision was merged to the branch mainline in revision 6404.
  • Revision ID: jelmer@samba.org-20111214183219-psb0o3exfsnhpemq
Cope with features already existing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1468
1468
            "required feature foo\n"
1469
1469
            "optional feature another\n")
1470
1470
 
1471
 
    def test_network_string(self):
 
1471
    def test_network_name(self):
1472
1472
        # The network string should include the feature info
1473
1473
        format = SampleBzrFormat()
1474
1474
        format.features = {"foo": "required"}
1475
1475
        self.assertEquals(
1476
1476
            "First line\nrequired feature foo\n",
1477
 
            format.network_string())
 
1477
            format.network_name())
1478
1478
 
1479
1479
    def test_from_string(self):
1480
1480
        format = SampleBzrFormat.from_string(
1525
1525
        self.addCleanup(SampleBzrFormat.unregister_feature, "nested trees")
1526
1526
        SampleBzrFormat.register_feature("nested trees")
1527
1527
        format.check_support_status(True)
 
1528
 
 
1529
    def test_feature_already_registered(self):
 
1530
        # treat unknown necessity as required
 
1531
        self.addCleanup(SampleBzrFormat.unregister_feature, "nested trees")
 
1532
        SampleBzrFormat.register_feature("nested trees")
 
1533
        self.assertRaises(errors.FeatureAlreadyRegistered,
 
1534
            SampleBzrFormat.register_feature, "nested trees")