comparison 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
comparison
equal deleted inserted replaced
1047:3092b3c109a8 1048:903c9c9dfe6a
98 def test_files_copied_from_outside_btt(self, stupid=False): 98 def test_files_copied_from_outside_btt(self, stupid=False):
99 repo = self._load_fixture_and_fetch( 99 repo = self._load_fixture_and_fetch(
100 'test_files_copied_from_outside_btt.svndump', stupid=stupid) 100 'test_files_copied_from_outside_btt.svndump', stupid=stupid)
101 self.assertEqual(node.hex(repo['tip'].node()), 101 self.assertEqual(node.hex(repo['tip'].node()),
102 '3c78170e30ddd35f2c32faa0d8646ab75bba4f73') 102 '3c78170e30ddd35f2c32faa0d8646ab75bba4f73')
103 self.assertEqual(len(repo.changelog), 2) 103 self.assertEqual(test_util.repolen(repo.changelog), 2)
104 104
105 def test_files_copied_from_outside_btt_stupid(self): 105 def test_files_copied_from_outside_btt_stupid(self):
106 self.test_files_copied_from_outside_btt(stupid=True) 106 self.test_files_copied_from_outside_btt(stupid=True)
107 107
108 def test_file_renamed_in_from_outside_btt(self): 108 def test_file_renamed_in_from_outside_btt(self):
171 repo = hg.repository(ui, wc_path) 171 repo = hg.repository(ui, wc_path)
172 repo2 = hg.repository(ui, wc2_path) 172 repo2 = hg.repository(ui, wc2_path)
173 173
174 self.assertEqual(repo['tip'].extra()['convert_revision'], 174 self.assertEqual(repo['tip'].extra()['convert_revision'],
175 repo2['tip'].extra()['convert_revision']) 175 repo2['tip'].extra()['convert_revision'])
176 self.assertEqual(len(repo), len(repo2)) 176 self.assertEqual(test_util.repolen(repo), test_util.repolen(repo2))
177 177
178 for r in repo: 178 for r in repo:
179 self.assertEqual(repo[r].hex(), repo2[r].hex()) 179 self.assertEqual(repo[r].hex(), repo2[r].hex())
180 180
181 def test_path_quoting_stupid(self): 181 def test_path_quoting_stupid(self):