All pastes #372536 Raw Edit

Unnamed

public text v1 · immutable
#372536 ·published 2007-02-26 03:46 UTC
rendered paste body
@@ -548,11 +562,21 @@
         self.assertEqual(master_tree.branch.revision_history(),
             tree.branch.revision_history())
 
-    def test_merge_modified(self):
+    def test_merge_modified_detects_corruption(self):
+        # FIXME: This doesn't really test that it works; also this is not
+        # implementation-independent. mbp 20070226
         tree = self.make_branch_and_tree('master')
         tree._control_files.put('merge-hashes', StringIO('asdfasdf'))
         self.assertRaises(errors.MergeModifiedFormatError, tree.merge_modified)
 
+    def test_merge_modified(self):
+        # merge_modified stores a map from file id to hash
+        tree = self.make_branch_and_tree('master')
+        d = {'file-id': '36db9e2019e38dcb5ce2340d2961a279'}
+        tree.set_merge_modified(d)
+        mm = tree.merge_modified()
+        self.assertEquals(mm, d)
+
     def test_conflicts(self):
         from bzrlib.tests.test_conflicts import example_conflicts
         tree = self.make_branch_and_tree('master')