comparison tests/test_fetch_symlinks.py @ 126:24a64fb0e74b

run.py: register and develop test_fetch_symlinks
author Patrick Mezard <pmezard@gmail.com>
date Wed, 10 Dec 2008 11:03:19 -0600
parents a3b717e4abf5
children b37c401b7f92
comparison
equal deleted inserted replaced
125:c35f59aa200e 126:24a64fb0e74b
16 for f in r.manifest(): 16 for f in r.manifest():
17 if 'l' not in r[f].flags(): 17 if 'l' not in r[f].flags():
18 continue 18 continue
19 self.assertFalse(r[f].data().startswith('link ')) 19 self.assertFalse(r[f].data().startswith('link '))
20 # Check symlinks in tip 20 # Check symlinks in tip
21 tip = repo['tip']
22 links = { 21 links = {
23 'linkaa': 'b', 22 0: {
24 'd2/linka': 'b', 23 'linka': 'a',
24 'd/linka': 'a',
25 },
26 1: {
27 'linkaa': 'a',
28 'd2/linka': 'a',
29 },
30 2: {
31 'linkaa': 'b',
32 'd2/linka': 'b',
33 },
34 3: {
35 },
25 } 36 }
26 for f in tip.manifest(): 37
27 self.assertEqual(f in links, 'l' in tip[f].flags()) 38 for rev in repo:
28 if f in links: 39 ctx = repo[rev]
29 self.assertEqual(links[f], tip[f].data()) 40 for f in ctx.manifest():
41 self.assertEqual(f in links[rev], 'l' in ctx[f].flags())
42 if f in links[rev]:
43 self.assertEqual(links[rev][f], ctx[f].data())
44 for f in links[rev]:
45 self.assertTrue(f in ctx)
30 46
31 def test_symlinks_stupid(self): 47 def test_symlinks_stupid(self):
32 self.test_symlinks(True) 48 self.test_symlinks(True)
33 49
34 def suite(): 50 def suite():