Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweak style to conform to best conventions. Remove unused variable.
  • Loading branch information
jaraco committed Feb 20, 2023
commit 31b71a9c36540b5e79a7d1e206db8f29fc31f0a6
3 changes: 2 additions & 1 deletion Lib/test/test_zipfile/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3009,6 +3009,7 @@ def test_cli_with_metadata_encoding_extract(self):
for name in self.file_names:
self.assertIn(name, listing)


class StripExtraTests(unittest.TestCase):
# Note: all of the "z" characters are technically invalid, but up to 3 bytes
# at the end of the extra will be passed through as they are too short to
Expand Down Expand Up @@ -3045,7 +3046,6 @@ def test_multiples(self):
s = struct.Struct("<HH")
a = s.pack(1, 1) + b"a" # 1=zip64 extra signature
b = s.pack(2, 2) + b"bb"
c = s.pack(3, 3) + b"ccc"

self.assertEqual(b"", zipfile._strip_extra(a+a, (1,)))
self.assertEqual(b"", zipfile._strip_extra(a+a+a, (1,)))
Expand All @@ -3062,5 +3062,6 @@ def test_too_short(self):
self.assertEqual(b"zz", zipfile._strip_extra(b"zz", (1,)))
self.assertEqual(b"zzz", zipfile._strip_extra(b"zzz", (1,)))


if __name__ == "__main__":
unittest.main()