diff tests/comprehensive/test_verify_and_startrev.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 cd0d14e25757
line wrap: on
line diff
--- a/tests/comprehensive/test_verify_and_startrev.py
+++ b/tests/comprehensive/test_verify_and_startrev.py
@@ -37,10 +37,9 @@ from hgsubversion import verify
     'emptyrepo2.svndump',
 ])
 
-def _do_case(self, name, stupid, layout):
+def _do_case(self, name, layout):
     subdir = test_util.subdir.get(name, '')
-    repo, svnpath = self.load_and_fetch(name, subdir=subdir, stupid=stupid,
-                                        layout=layout)
+    repo, svnpath = self.load_and_fetch(name, subdir=subdir, layout=layout)
     assert test_util.repolen(self.repo) > 0
     for i in repo:
         ctx = repo[i]
@@ -52,7 +51,7 @@ def _do_case(self, name, stupid, layout)
     # check a startrev clone
     if layout == 'single' and name not in _skipshallow:
         self.wc_path += '_shallow'
-        shallowrepo = self.fetch(svnpath, subdir=subdir, stupid=stupid,
+        shallowrepo = self.fetch(svnpath, subdir=subdir,
                                  layout='single', startrev='HEAD')
 
         self.assertEqual(test_util.repolen(shallowrepo), 1,
@@ -85,26 +84,21 @@ def _do_case(self, name, stupid, layout)
             self.assertMultiLineEqual(fulltip[f].data(), shallowtip[f].data())
 
 
-def buildmethod(case, name, stupid, layout):
-    m = lambda self: self._do_case(case, stupid, layout)
+def buildmethod(case, name, layout):
+    m = lambda self: self._do_case(case, layout)
     m.__name__ = name
-    bits = case, stupid and 'stupid' or 'real', layout
-    m.__doc__ = 'Test verify on %s with %s replay. (%s)' % bits
+    m.__doc__ = 'Test verify on %s (%s)' % (case, layout)
     return m
 
-attrs = {'_do_case': _do_case}
+attrs = {'_do_case': _do_case, 'stupid_mode_tests': True}
 fixtures = [f for f in os.listdir(test_util.FIXTURES) if f.endswith('.svndump')]
 for case in fixtures:
     if case in _skipall:
         continue
     bname = 'test_' + case[:-len('.svndump')]
     if case not in _skipstandard:
-        attrs[bname] = buildmethod(case, bname, False, 'standard')
-        name = bname + '_stupid'
-        attrs[name] = buildmethod(case, name, True, 'standard')
+        attrs[bname] = buildmethod(case, bname, 'standard')
     name = bname + '_single'
-    attrs[name] = buildmethod(case, name, False, 'single')
-    name = bname + '_single_stupid'
-    attrs[name] = buildmethod(case, name, True, 'single')
+    attrs[name] = buildmethod(case, name, 'single')
 
 VerifyTests = type('VerifyTests', (test_util.TestBase,), attrs)