comparison tests/test_fetch_branches.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 d741f536f23a
children b8142bbf6656
comparison
equal deleted inserted replaced
1047:3092b3c109a8 1048:903c9c9dfe6a
138 self.assertEqual(list(repo['dev_branch']), ['foo']) 138 self.assertEqual(list(repo['dev_branch']), ['foo'])
139 139
140 def test_replace_branch_with_branch(self, stupid=False): 140 def test_replace_branch_with_branch(self, stupid=False):
141 repo = self._load_fixture_and_fetch('replace_branch_with_branch.svndump', 141 repo = self._load_fixture_and_fetch('replace_branch_with_branch.svndump',
142 stupid=stupid) 142 stupid=stupid)
143 self.assertEqual(7, len(repo)) 143 self.assertEqual(7, test_util.repolen(repo))
144 # tip is former topological branch1 being closed 144 # tip is former topological branch1 being closed
145 ctx = repo['tip'] 145 ctx = repo['tip']
146 self.assertEqual('1', ctx.extra().get('close', '0')) 146 self.assertEqual('1', ctx.extra().get('close', '0'))
147 self.assertEqual('branch1', ctx.branch()) 147 self.assertEqual('branch1', ctx.branch())
148 # r5 is where the replacement takes place 148 # r5 is where the replacement takes place