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.
This commit is contained in:
dgelessus 2020-01-19 02:30:10 +01:00
parent a7a407a1dd
commit fbd861edf4

View File

@ -52,6 +52,8 @@ class ResourceFileReadTests(unittest.TestCase):
for (actual_type, actual_reses), (expected_type, expected_reses) in zip(rf.items(), TEXTCLIPPING_RESOURCES.items()): for (actual_type, actual_reses), (expected_type, expected_reses) in zip(rf.items(), TEXTCLIPPING_RESOURCES.items()):
with self.subTest(type=expected_type): with self.subTest(type=expected_type):
self.assertEqual(actual_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()): for (actual_id, actual_res), (expected_id, expected_data) in zip(actual_reses.items(), expected_reses.items()):
with self.subTest(id=expected_id): with self.subTest(id=expected_id):
self.assertEqual(actual_res.type, expected_type) self.assertEqual(actual_res.type, expected_type)