diff tests/comprehensive/test_updatemeta.py @ 1057:cd256960b622

comprehensive tests: consolidate stupidity into test_util In other words, remove explicit 'stupid' arguments, set the 'stupid_mode_tests' class variable, and have the metaclass generate non-replay tests.
author Dan Villiom Podlaski Christiansen <dan@cabo.dk>
date Wed, 07 Aug 2013 23:31:57 +0200
parents 903c9c9dfe6a
children 48379ebd2763
line wrap: on
line diff
--- a/tests/comprehensive/test_updatemeta.py
+++ b/tests/comprehensive/test_updatemeta.py
@@ -22,13 +22,12 @@ from hgsubversion import svnmeta
 
 
 
-def _do_case(self, name, stupid, single):
+def _do_case(self, name, single):
     subdir = test_util.subdir.get(name, '')
     layout = 'auto'
     if single:
         layout = 'single'
-    repo, repo_path = self.load_and_fetch(name, subdir=subdir, stupid=stupid,
-                                          layout=layout)
+    repo, repo_path = self.load_and_fetch(name, subdir=subdir, layout=layout)
     assert test_util.repolen(self.repo) > 0
     wc2_path = self.wc_path + '_clone'
     u = ui.ui()
@@ -53,11 +52,11 @@ def _do_case(self, name, stupid, single)
         # remove the wrapper
         context.changectx.children = origchildren
 
-    self._run_assertions(name, stupid, single, src, dest, u)
+    self._run_assertions(name, single, src, dest, u)
 
 
-def _run_assertions(self, name, stupid, single, src, dest, u):
-    test_rebuildmeta._run_assertions(self, name, stupid, single, src, dest, u)
+def _run_assertions(self, name, single, src, dest, u):
+    test_rebuildmeta._run_assertions(self, name, single, src, dest, u)
 
 
 skip = set([
@@ -67,16 +66,15 @@ skip = set([
 
 attrs = {'_do_case': _do_case,
          '_run_assertions': _run_assertions,
+         'stupid_mode_tests': True,
          }
 for case in [f for f in os.listdir(test_util.FIXTURES) if f.endswith('.svndump')]:
     # this fixture results in an empty repository, don't use it
     if case in skip:
         continue
     bname = 'test_' + case[:-len('.svndump')]
-    attrs[bname] = test_rebuildmeta.buildmethod(case, bname, False, False)
-    name = bname + '_stupid'
-    attrs[name] = test_rebuildmeta.buildmethod(case, name, True, False)
+    attrs[bname] = test_rebuildmeta.buildmethod(case, bname, False)
     name = bname + '_single'
-    attrs[name] = test_rebuildmeta.buildmethod(case, name, False, True)
+    attrs[name] = test_rebuildmeta.buildmethod(case, name, True)
 
 UpdateMetaTests = type('UpdateMetaTests', (test_util.TestBase,), attrs)