|
19 | 19 | ) |
20 | 20 |
|
21 | 21 |
|
22 | | -def test_magic(f, magic_hexes): |
| 22 | +def check_magic(f, magic_hexes): |
23 | 23 | """Tests a given file to see if the magic hex matches.""" |
24 | 24 | data = f.read(len(magic_hexes)) |
25 | 25 | if len(data) != len(magic_hexes): |
@@ -326,7 +326,7 @@ def test_save(self): |
326 | 326 | # Test the magic numbers at the start of the file to ensure |
327 | 327 | # they are saved as the correct file type. |
328 | 328 | self.assertEqual( |
329 | | - (1, fmt), (test_magic(handle, magic_hex[fmt.lower()]), fmt) |
| 329 | + (1, fmt), (check_magic(handle, magic_hex[fmt.lower()]), fmt) |
330 | 330 | ) |
331 | 331 |
|
332 | 332 | # load the file to make sure it was saved correctly. |
@@ -410,7 +410,7 @@ def test_save__to_fileobject_w_namehint_argument(self): |
410 | 410 | # ensure they are saved as the correct file type. |
411 | 411 | handle.seek(0) |
412 | 412 | self.assertEqual( |
413 | | - (1, fmt), (test_magic(handle, magic_hex[fmt.lower()]), fmt) |
| 413 | + (1, fmt), (check_magic(handle, magic_hex[fmt.lower()]), fmt) |
414 | 414 | ) |
415 | 415 | # load the file to make sure it was saved correctly. |
416 | 416 | handle.flush() |
@@ -1344,7 +1344,7 @@ def test_save_extended(self): |
1344 | 1344 | with open(temp_file_name, "rb") as file: |
1345 | 1345 | # Test the magic numbers at the start of the file to ensure |
1346 | 1346 | # they are saved as the correct file type. |
1347 | | - self.assertEqual(1, (test_magic(file, magic_hex[fmt.lower()]))) |
| 1347 | + self.assertEqual(1, (check_magic(file, magic_hex[fmt.lower()]))) |
1348 | 1348 | # load the file to make sure it was saved correctly |
1349 | 1349 | loaded_file = pygame.image.load(temp_file_name) |
1350 | 1350 | self.assertEqual(loaded_file.get_at((0, 0)), surf.get_at((0, 0))) |
|
0 commit comments