##// END OF EJS Templates
test-manifest: create constant for empty manifest...
Martin von Zweigbergk -
r24569:5491248e default
parent child Browse files
Show More
@@ -7,6 +7,8 b' import silenttestrunner'
7 7 from mercurial import manifest as manifestmod
8 8 from mercurial import match as matchmod
9 9
10 EMTPY_MANIFEST = ''
11
10 12 HASH_1 = '1' * 40
11 13 HASH_2 = 'f' * 40
12 14 HASH_3 = '1234567890abcdef0987654321deadbeef0fcafe'
@@ -68,7 +70,7 b' class testmanifest(unittest.TestCase):'
68 70 self.assert_(thing in container, msg)
69 71
70 72 def testEmptyManifest(self):
71 m = parsemanifest('')
73 m = parsemanifest(EMTPY_MANIFEST)
72 74 self.assertEqual(0, len(m))
73 75 self.assertEqual([], list(m))
74 76
@@ -84,7 +86,7 b' class testmanifest(unittest.TestCase):'
84 86 def testSetItem(self):
85 87 want = binascii.unhexlify(HASH_1)
86 88
87 m = parsemanifest('')
89 m = parsemanifest(EMTPY_MANIFEST)
88 90 m['a'] = want
89 91 self.assertIn('a', m)
90 92 self.assertEqual(want, m['a'])
@@ -99,7 +101,7 b' class testmanifest(unittest.TestCase):'
99 101 def testSetFlag(self):
100 102 want = 'x'
101 103
102 m = parsemanifest('')
104 m = parsemanifest(EMTPY_MANIFEST)
103 105 # first add a file; a file-less flag makes no sense
104 106 m['a'] = binascii.unhexlify(HASH_1)
105 107 m.setflag('a', want)
@@ -214,14 +216,14 b' class testmanifest(unittest.TestCase):'
214 216 'foo': (MISSING, (binascii.unhexlify(HASH_3), 'x')),
215 217 'z-only-in-left': (MISSING, (binascii.unhexlify(HASH_1), '')),
216 218 }
217 self.assertEqual(want, parsemanifest('').diff(left))
219 self.assertEqual(want, parsemanifest(EMTPY_MANIFEST).diff(left))
218 220
219 221 want = {
220 222 'bar/baz/qux.py': ((binascii.unhexlify(HASH_2), 'l'), MISSING),
221 223 'foo': ((binascii.unhexlify(HASH_3), 'x'), MISSING),
222 224 'z-only-in-left': ((binascii.unhexlify(HASH_1), ''), MISSING),
223 225 }
224 self.assertEqual(want, left.diff(parsemanifest('')))
226 self.assertEqual(want, left.diff(parsemanifest(EMTPY_MANIFEST)))
225 227 copy = right.copy()
226 228 del copy['z-only-in-right']
227 229 del right['foo']
General Comments 0
You need to be logged in to leave comments. Login now