diff tests/test_fetch_renames.py @ 73:9c1b53abefcb

fetch_command: support svn copy detection in stupid mode
author Patrick Mezard <pmezard@gmail.com>
date Wed, 05 Nov 2008 13:37:08 +0100
parents 63ece4ea25c9
children 072010a271c6
line wrap: on
line diff
--- a/tests/test_fetch_renames.py
+++ b/tests/test_fetch_renames.py
@@ -23,9 +23,9 @@ class TestFetchRenames(unittest.TestCase
         shutil.rmtree(self.tmpdir)
         os.chdir(self.oldwd)
 
-    def _load_fixture_and_fetch(self, fixture_name):
+    def _load_fixture_and_fetch(self, fixture_name, stupid):
         return test_util.load_fixture_and_fetch(fixture_name, self.repo_path,
-                                                self.wc_path)
+                                                self.wc_path, stupid=stupid)
 
     def _debug_print_copies(self, repo):
         w = sys.stderr.write
@@ -36,8 +36,8 @@ class TestFetchRenames(unittest.TestCase
                 fctx = ctx[f]
                 w('%s: %r %r\n' % (f, fctx.data(), fctx.renamed()))
 
-    def test_rename(self):
-        repo = self._load_fixture_and_fetch('renames.svndump')
+    def _test_rename(self, stupid):
+        repo = self._load_fixture_and_fetch('renames.svndump', stupid)
         # self._debug_print_copies(repo)
 
         # Map revnum to mappings of dest name to (source name, dest content)
@@ -71,6 +71,12 @@ class TestFetchRenames(unittest.TestCase
                 self.assertEqual(cp[0], copymap[f][0])
                 self.assertEqual(ctx[f].data(), copymap[f][1])
 
+    def test_rename(self):
+        self._test_rename(False)
+
+    def test_rename_stupid(self):
+        self._test_rename(True)
+
 def suite():
     all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchRenames),
           ]