From fbd861edf4d6a10f2e372c5374b011780149bce7 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sun, 19 Jan 2020 02:30:10 +0100 Subject: [PATCH] Fix test_textclipping not checking resource ID lists properly Because Python's zip terminates once *any* of the input iterables terminates, the previous code would not detect if the file was missing resources or contained extra ones. --- tests/test_rsrcfork.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_rsrcfork.py b/tests/test_rsrcfork.py index 1425c50..32be4c3 100644 --- a/tests/test_rsrcfork.py +++ b/tests/test_rsrcfork.py @@ -52,6 +52,8 @@ class ResourceFileReadTests(unittest.TestCase): for (actual_type, actual_reses), (expected_type, expected_reses) in zip(rf.items(), TEXTCLIPPING_RESOURCES.items()): with self.subTest(type=expected_type): self.assertEqual(actual_type, expected_type) + self.assertEqual(list(actual_reses), list(expected_reses)) + for (actual_id, actual_res), (expected_id, expected_data) in zip(actual_reses.items(), expected_reses.items()): with self.subTest(id=expected_id): self.assertEqual(actual_res.type, expected_type)