~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to multiparent/tests/test_multiparent.py

  • Committer: Aaron Bentley
  • Date: 2007-04-11 20:39:57 UTC
  • mto: (2520.4.1 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070411203957-j7uadxym4214p6ly
Implement from_patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
            list(multiparent.MultiParent([multiparent.NewText(['a\n']),
61
61
            multiparent.ParentText(0, 1, 2, 3)]).to_patch()))
62
62
 
 
63
    def test_from_patch(self):
 
64
        self.assertEqual(multiparent.MultiParent(
 
65
            [multiparent.NewText(['a\n']),
 
66
             multiparent.ParentText(0, 1, 2, 3)]),
 
67
             multiparent.MultiParent.from_patch(
 
68
             ['i 1\n', 'a\n', '\n', 'c 0 1 2 3\n']))
 
69
        self.assertEqual(multiparent.MultiParent(
 
70
            [multiparent.NewText(['a']),
 
71
             multiparent.ParentText(0, 1, 2, 3)]),
 
72
             multiparent.MultiParent.from_patch(
 
73
             ['i 1\n', 'a\n', 'c 0 1 2 3\n']))
 
74
 
63
75
    def test_num_lines(self):
64
76
        mp = multiparent.MultiParent([multiparent.NewText(['a\n'])])
65
77
        self.assertEqual(1, mp.num_lines())