diff tests/test_fetch_command.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 67e11b650e94
children c41e993f0892
line wrap: on
line diff
--- a/tests/test_fetch_command.py
+++ b/tests/test_fetch_command.py
@@ -100,7 +100,7 @@ class TestBasicRepoLayout(test_util.Test
             'test_files_copied_from_outside_btt.svndump', stupid=stupid)
         self.assertEqual(node.hex(repo['tip'].node()),
                          '3c78170e30ddd35f2c32faa0d8646ab75bba4f73')
-        self.assertEqual(len(repo.changelog), 2)
+        self.assertEqual(test_util.repolen(repo.changelog), 2)
 
     def test_files_copied_from_outside_btt_stupid(self):
         self.test_files_copied_from_outside_btt(stupid=True)
@@ -173,7 +173,7 @@ class TestBasicRepoLayout(test_util.Test
 
         self.assertEqual(repo['tip'].extra()['convert_revision'],
                          repo2['tip'].extra()['convert_revision'])
-        self.assertEqual(len(repo), len(repo2))
+        self.assertEqual(test_util.repolen(repo), test_util.repolen(repo2))
 
         for r in repo:
             self.assertEqual(repo[r].hex(), repo2[r].hex())