-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-37529: Add test for guessing extensions #28243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-37529: Add test for guessing extensions #28243
Conversation
@@ -150,6 +150,13 @@ def test_init_reinitializes(self): | |||
# Poison should be gone. | |||
self.assertEqual(mimetypes.guess_extension('foo/bar'), None) | |||
|
|||
@unittest.skipIf(sys.platform.startswith("win"), "Non-Windows only") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why non-Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On windows there is a test failure because windows seems to add mime types from its registry and that creates some duplicates; I don't have windows system available so I can't determine which types get duplicated or how many.
However it seems sufficient to test this on non-windows systems because the goal of the test is to check all of the types in the dictionary here:
Line 431 in 5277ffe
types_map = _types_map_default = { |
- all of these would be tested on non-windows systems (or even on one specific non windows system).
This PR is stale because it has been open for 30 days with no activity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran 21 tests in 0.016s
OK (skipped=2)
== Tests result: SUCCESS ==
Thanks! |
Thank you @MaxwellDupre and @asvetlov ! |
Note that this test is for duplicated extensions, in which case
guess_extension()
returns None, so it's enough to test for this returned value for all known mime types.Skipping on windows because there windows adds mime types from its registry and that creates some duplicates; I don't have windows system available so I can't determine which types get duplicated or how many.
https://bugs.python.org/issue37529