bpo-37529: Add test for guessing extensions#28243
Merged
asvetlov merged 3 commits intopython:mainfrom Mar 12, 2022
Merged
Conversation
| # Poison should be gone. | ||
| self.assertEqual(mimetypes.guess_extension('foo/bar'), None) | ||
|
|
||
| @unittest.skipIf(sys.platform.startswith("win"), "Non-Windows only") |
Contributor
Author
There was a problem hiding this comment.
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
- 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. |
MaxwellDupre
approved these changes
Mar 9, 2022
Contributor
There was a problem hiding this comment.
Ran 21 tests in 0.016s
OK (skipped=2)
== Tests result: SUCCESS ==
asvetlov
approved these changes
Mar 12, 2022
Contributor
|
Thanks! |
Contributor
Author
|
Thank you @MaxwellDupre and @asvetlov ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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