diff tests/comprehensive/test_verify.py @ 499:1fd3cfa47c5e

Support for single-directory clones.
author Augie Fackler <durin42@gmail.com>
date Fri, 16 Oct 2009 23:33:41 -0400
parents de085126dbd4
children 124cd25de4ef
line wrap: on
line diff
--- a/tests/comprehensive/test_verify.py
+++ b/tests/comprehensive/test_verify.py
@@ -14,19 +14,19 @@ from mercurial import ui
 
 from hgsubversion import svncommands
 
-def _do_case(self, name, stupid):
+def _do_case(self, name, stupid, layout):
     subdir = test_util.subdir.get(name, '')
-    repo = self._load_fixture_and_fetch(name, subdir=subdir, stupid=stupid)
+    repo = self._load_fixture_and_fetch(name, subdir=subdir, stupid=stupid, layout=layout)
     assert len(self.repo) > 0
     for i in repo:
         ctx = repo[i]
         self.assertEqual(svncommands.verify(repo.ui, repo, rev=ctx.node()), 0)
 
-def buildmethod(case, name, stupid):
-    m = lambda self: self._do_case(case, stupid)
+def buildmethod(case, name, stupid, layout):
+    m = lambda self: self._do_case(case, stupid, layout)
     m.__name__ = name
-    bits = case, stupid and 'stupid' or 'real'
-    m.__doc__ = 'Test verify on %s with %s replay.' % bits
+    bits = case, stupid and 'stupid' or 'real', layout
+    m.__doc__ = 'Test verify on %s with %s replay. (%s)' % bits
     return m
 
 attrs = {'_do_case': _do_case}
@@ -35,10 +35,16 @@ for case in fixtures:
     # this fixture results in an empty repository, don't use it
     if case == 'project_root_not_repo_root.svndump':
         continue
-    name = 'test_' + case[:-len('.svndump')]
-    attrs[name] = buildmethod(case, name, False)
-    name += '_stupid'
-    attrs[name] = buildmethod(case, name, True)
+    bname = 'test_' + case[:-len('.svndump')]
+    attrs[bname] = buildmethod(case, bname, False, 'standard')
+    name = bname + '_stupid'
+    attrs[name] = buildmethod(case, name, True, 'standard')
+    name = bname + '_single'
+    attrs[name] = buildmethod(case, name, False, 'single')
+    # Disabled because the "stupid and real are the same" tests
+    # verify this plus even more.
+    # name = bname + '_single_stupid'
+    # attrs[name] = buildmethod(case, name, True, 'single')
 
 VerifyTests = type('VerifyTests', (test_util.TestBase,), attrs)