diff -r b8d0761a85c7 -r 0147a4730420 tests/test-manifest.py --- a/tests/test-manifest.py Wed Feb 21 16:47:39 2018 -0800 +++ b/tests/test-manifest.py Thu Feb 22 20:04:42 2018 -0500 @@ -11,7 +11,6 @@ ) EMTPY_MANIFEST = b'' -EMTPY_MANIFEST_V2 = b'\0\n' HASH_1 = b'1' * 40 BIN_HASH_1 = binascii.unhexlify(HASH_1) @@ -28,42 +27,6 @@ b'flag2': b'l', } -# Same data as A_SHORT_MANIFEST -A_SHORT_MANIFEST_V2 = ( - b'\0\n' - b'\x00bar/baz/qux.py\0%(flag2)s\n%(hash2)s\n' - b'\x00foo\0%(flag1)s\n%(hash1)s\n' - ) % {b'hash1': BIN_HASH_1, - b'flag1': b'', - b'hash2': BIN_HASH_2, - b'flag2': b'l', - } - -# Same data as A_SHORT_MANIFEST -A_METADATA_MANIFEST = ( - b'\0foo\0bar\n' - b'\x00bar/baz/qux.py\0%(flag2)s\0foo\0bar\n%(hash2)s\n' # flag and metadata - b'\x00foo\0%(flag1)s\0foo\n%(hash1)s\n' # no flag, but metadata - ) % {b'hash1': BIN_HASH_1, - b'flag1': b'', - b'hash2': BIN_HASH_2, - b'flag2': b'l', - } - -A_STEM_COMPRESSED_MANIFEST = ( - b'\0\n' - b'\x00bar/baz/qux.py\0%(flag2)s\n%(hash2)s\n' - b'\x04qux/foo.py\0%(flag1)s\n%(hash1)s\n' # simple case of 4 stem chars - b'\x0az.py\0%(flag1)s\n%(hash1)s\n' # tricky newline = 10 stem characters - b'\x00%(verylongdir)sx/x\0\n%(hash1)s\n' - b'\xffx/y\0\n%(hash2)s\n' # more than 255 stem chars - ) % {b'hash1': BIN_HASH_1, - b'flag1': b'', - b'hash2': BIN_HASH_2, - b'flag2': b'l', - b'verylongdir': 255 * b'x', - } - A_DEEPER_MANIFEST = ( b'a/b/c/bar.py\0%(hash3)s%(flag1)s\n' b'a/b/c/bar.txt\0%(hash1)s%(flag1)s\n' @@ -111,11 +74,6 @@ self.assertEqual(0, len(m)) self.assertEqual([], list(m)) - def testEmptyManifestv2(self): - m = self.parsemanifest(EMTPY_MANIFEST_V2) - self.assertEqual(0, len(m)) - self.assertEqual([], list(m)) - def testManifest(self): m = self.parsemanifest(A_SHORT_MANIFEST) self.assertEqual([b'bar/baz/qux.py', b'foo'], list(m)) @@ -126,31 +84,6 @@ with self.assertRaises(KeyError): m[b'wat'] - def testParseManifestV2(self): - m1 = self.parsemanifest(A_SHORT_MANIFEST) - m2 = self.parsemanifest(A_SHORT_MANIFEST_V2) - # Should have same content as A_SHORT_MANIFEST - self.assertEqual(m1.text(), m2.text()) - - def testParseManifestMetadata(self): - # Metadata is for future-proofing and should be accepted but ignored - m = self.parsemanifest(A_METADATA_MANIFEST) - self.assertEqual(A_SHORT_MANIFEST, m.text()) - - def testParseManifestStemCompression(self): - m = self.parsemanifest(A_STEM_COMPRESSED_MANIFEST) - self.assertIn(b'bar/baz/qux.py', m) - self.assertIn(b'bar/qux/foo.py', m) - self.assertIn(b'bar/qux/foz.py', m) - self.assertIn(256 * b'x' + b'/x', m) - self.assertIn(256 * b'x' + b'/y', m) - self.assertEqual(A_STEM_COMPRESSED_MANIFEST, m.text(usemanifestv2=True)) - - def testTextV2(self): - m1 = self.parsemanifest(A_SHORT_MANIFEST) - v2text = m1.text(usemanifestv2=True) - self.assertEqual(A_SHORT_MANIFEST_V2, v2text) - def testSetItem(self): want = BIN_HASH_1