~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_weave.py

  • Committer: John Arbash Meinel
  • Date: 2006-01-31 14:09:11 UTC
  • mto: (1185.50.65 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: john@arbash-meinel.com-20060131140911-3bc59456e076f236
When reweaving weaves, if texts don't match, log the differences rather than a plain assert

Show diffs side-by-side

added added

removed removed

Lines of Context:
1053
1053
        w1.join(w2) # extract 3a to add txt2 
1054
1054
        w2.join(w1) # extract 3b to add txt1 
1055
1055
 
 
1056
 
 
1057
class MismatchedTexts(TestCase):
 
1058
    """Test that merging two weaves with different texts fails."""
 
1059
 
 
1060
    def test_reweave(self):
 
1061
        w1 = Weave('a')
 
1062
        w2 = Weave('b')
 
1063
 
 
1064
        w1.add('txt0', [], ['a\n'])
 
1065
        w2.add('txt0', [], ['a\n'])
 
1066
        w1.add('txt1', [0], ['a\n', 'b\n'])
 
1067
        w2.add('txt1', [0], ['a\n', 'c\n'])
 
1068
 
 
1069
        self.assertRaises(errors.WeaveTextDiffers, w1.reweave, w2)
 
1070
 
 
1071