~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 00:16:09 UTC
  • mto: (2520.4.1 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: aaron.bentley@utoronto.ca-20070411001609-fbx52la1yi0o3ui9
get add_version working

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
    def test_to_patch(self):
85
85
        self.assertEqual(['c 0 1 2 3\n'],
86
86
                         list(multiparent.ParentText(0, 1, 2, 3).to_patch()))
 
87
 
 
88
 
 
89
class TestVersionedFile(TestCase):
 
90
 
 
91
    def add_version(self, vf, text, version_id, parent_ids):
 
92
        vf.add_version([(t+'\n') for t in text], version_id, parent_ids)
 
93
 
 
94
    def test_add_version(self):
 
95
        vf = multiparent.MultiVersionedFile()
 
96
        self.add_version(vf, 'abcd', 'rev-a', [])
 
97
        self.assertEqual(vf._lines['rev-a'], ['a\n', 'b\n', 'c\n', 'd\n'])
 
98
        vf.clear_cache()
 
99
        self.assertEqual(vf._lines, {})