Mercurial > hgsubversion
diff tests/comprehensive/test_verify_and_startrev.py @ 1048:903c9c9dfe6a
tests: count revisions explicitly
The assumption that len(repo) corresponds to the count of actual,
usable revision in the repository fails in presence of hidden
revisions. Instead, we use a dedicated method in test_util, and change
all tests to use this for obtaining repository length -- just to be
safe...
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Fri, 09 Aug 2013 11:22:50 -0400 |
parents | 36fe4b316a6b |
children | cd256960b622 |
line wrap: on
line diff
--- a/tests/comprehensive/test_verify_and_startrev.py +++ b/tests/comprehensive/test_verify_and_startrev.py @@ -41,7 +41,7 @@ def _do_case(self, name, stupid, layout) subdir = test_util.subdir.get(name, '') repo, svnpath = self.load_and_fetch(name, subdir=subdir, stupid=stupid, layout=layout) - assert len(self.repo) > 0 + assert test_util.repolen(self.repo) > 0 for i in repo: ctx = repo[i] self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(), @@ -55,9 +55,9 @@ def _do_case(self, name, stupid, layout) shallowrepo = self.fetch(svnpath, subdir=subdir, stupid=stupid, layout='single', startrev='HEAD') - self.assertEqual(len(shallowrepo), 1, + self.assertEqual(test_util.repolen(shallowrepo), 1, "shallow clone should have just one revision, not %d" - % len(shallowrepo)) + % test_util.repolen(shallowrepo)) fulltip = repo['tip'] shallowtip = shallowrepo['tip']