Rev 4626: Prepare for tests dir/symlink tests. in file:///home/vila/src/bzr/experimental/conflict-manager/

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Mar 3 13:21:41 GMT 2010


At file:///home/vila/src/bzr/experimental/conflict-manager/

------------------------------------------------------------
revno: 4626
revision-id: v.ladeuil+lp at free.fr-20100303132140-e9cezslca4np6nhb
parent: v.ladeuil+lp at free.fr-20100303131355-lkivtt0s1q1ljy5t
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanup
timestamp: Wed 2010-03-03 14:21:40 +0100
message:
  Prepare for tests dir/symlink tests.
  
  * bzrlib/tests/test_conflicts.py:
  (content_conflict_scenarios, TestResolveContentConflicts):
  s/file/item/ so we can reuse some helpers for dirs and symlinks.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py	2010-03-03 13:13:55 +0000
+++ b/bzrlib/tests/test_conflicts.py	2010-03-03 13:21:40 +0000
@@ -213,8 +213,8 @@
     base_scenarios = [
         (('file', 'None'), dict(_this_actions='modify_file',
                            _check_this='file_has_more_content',
-                           _other_actions='delete_file',
-                           _check_other='file_doesnt_exist',
+                           _other_actions='delete_item',
+                           _check_other='item_doesnt_exist',
                            )),
         ]
     # Each base scenario is duplicated switching the roles of this and other
@@ -224,15 +224,15 @@
             ('%s,%s' % (t, o),
              dict(_this_actions=d['_this_actions'],
                   _check_this=d['_check_this'],
-                  _other_actions=['_other_actions'],
-                  _check_other=['_check_other'],
+                  _other_actions=d['_other_actions'],
+                  _check_other=d['_check_other'],
                   )))
         scenarios.append(
             ('%s,%s' % (o, t),
              dict(_this_actions=d['_other_actions'],
                   _check_this=d['_check_other'],
-                  _other_actions=['_this_actions'],
-                  _check_other=['_check_this'],
+                  _other_actions=d['_this_actions'],
+                  _check_other=d['_check_this'],
                   )))
     return scenarios
 
@@ -252,7 +252,7 @@
                 ('add', ('', 'root-id', 'directory', ''))])
         # Add a minimal base content
         builder.build_snapshot('base', ['start'], [
-                ('add', ('file', 'file-id', 'file', 'trunk content\n'))])
+                ('add', ('item', 'item-id', 'file', 'trunk content\n'))])
         # Modify the base content in branch
         other_actions = self._get_actions(self._other_actions)
         builder.build_snapshot('other', ['base'], other_actions())
@@ -269,16 +269,16 @@
         return getattr(self, 'check_%s' % name)
 
     def do_modify_file(self):
-        return [('modify', ('file-id', 'trunk content\nmore content\n'))]
+        return [('modify', ('item-id', 'trunk content\nmore content\n'))]
 
     def check_file_has_more_content(self):
-        self.assertFileEqual('trunk content\nmore content\n', 'branch/file')
-
-    def do_delete_file(self):
-        return [('unversion', 'file-id')]
-
-    def check_file_doesnt_exist(self):
-        self.failIfExists('branch/file')
+        self.assertFileEqual('trunk content\nmore content\n', 'branch/item')
+
+    def do_delete_item(self):
+        return [('unversion', 'item-id')]
+
+    def check_item_doesnt_exist(self):
+        self.failIfExists('branch/item')
 
     def _merge_other_into_this(self):
         b = self.builder.get_branch()
@@ -304,16 +304,16 @@
     def test_resolve_taking_this(self):
         wt = self._merge_other_into_this()
         self.assertConflict(wt, conflicts.ContentsConflict,
-                            path='file', file_id='file-id',)
-        self.check_resolved(wt, 'file', 'take_this')
+                            path='item', file_id='item-id',)
+        self.check_resolved(wt, 'item', 'take_this')
         check_this = self._get_check(self._check_this)
         check_this()
 
     def test_resolve_taking_other(self):
         wt = self._merge_other_into_this()
         self.assertConflict(wt, conflicts.ContentsConflict,
-                            path='file', file_id='file-id',)
-        self.check_resolved(wt, 'file', 'take_other')
+                            path='item', file_id='item-id',)
+        self.check_resolved(wt, 'item', 'take_other')
         check_other = self._get_check(self._check_other)
         check_other()
 



More information about the bazaar-commits mailing list