comparison tests/test_fetch_renames.py @ 1483:4379baf58f9e stable

test_fetch_renames: refactoring to make debugging easier
author Augie Fackler <raf@durin42.com>
date Sun, 26 Jun 2016 20:25:52 -0400
parents 6b15eeb78c1a
children 9f1fa3cc6ba5
comparison
equal deleted inserted replaced
1482:253b2ab253a1 1483:4379baf58f9e
73 for rev in repo: 73 for rev in repo:
74 ctx = repo[rev] 74 ctx = repo[rev]
75 copymap = copies.get(rev, {}) 75 copymap = copies.get(rev, {})
76 for f in ctx.manifest(): 76 for f in ctx.manifest():
77 cp = ctx[f].renamed() 77 cp = ctx[f].renamed()
78 self.assertEqual(bool(cp), bool(copymap.get(f)), 78 want = copymap.get(f)
79 'copy records differ for %s in %d' % (f, rev)) 79 self.assertEqual(
80 bool(cp), bool(want),
81 'copy records differ for %s in %d (want %r, got %r)' % (
82 f, rev, want, cp))
80 if not cp: 83 if not cp:
81 continue 84 continue
82 self.assertEqual(cp[0], copymap[f][0]) 85 self.assertEqual(cp[0], want[0])
83 self.assertEqual(ctx[f].data(), copymap[f][1]) 86 self.assertEqual(ctx[f].data(), want[1])
84 87
85 self.assertEqual(repo['tip']['changed3'].data(), 'changed\nchanged3\n') 88 self.assertEqual(repo['tip']['changed3'].data(), 'changed\nchanged3\n')
86 89
87 def test_case(self): 90 def test_case(self):
88 repo = self._load_fixture_and_fetch('filecase.svndump') 91 repo = self._load_fixture_and_fetch('filecase.svndump')