~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_weave.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-07-16 18:36:24 UTC
  • mfrom: (3514.2.19 weave_merge)
  • Revision ID: pqm@pqm.ubuntu.com-20080716183624-7yu6n1raw6sa4x80
(jam) Restore the real Weave merge for --format=weave.

Show diffs side-by-side

added added

removed removed

Lines of Context:
707
707
        self.assertRaises(errors.WeaveInvalidChecksum, w.check)
708
708
 
709
709
 
 
710
class TestWeave(TestCase):
 
711
 
 
712
    def test_allow_reserved_false(self):
 
713
        w = Weave('name', allow_reserved=False)
 
714
        # Add lines is checked at the WeaveFile level, not at the Weave level
 
715
        w.add_lines('name:', [], TEXT_1)
 
716
        # But get_lines is checked at this level
 
717
        self.assertRaises(errors.ReservedId, w.get_lines, 'name:')
 
718
 
 
719
    def test_allow_reserved_true(self):
 
720
        w = Weave('name', allow_reserved=True)
 
721
        w.add_lines('name:', [], TEXT_1)
 
722
        self.assertEqual(TEXT_1, w.get_lines('name:'))
 
723
 
 
724
 
710
725
class InstrumentedWeave(Weave):
711
726
    """Keep track of how many times functions are called."""
712
727