-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-39299: Add more tests for mimetypes and its cli. #17949
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
Conversation
Ah, the logic to load the initial database is with known types, common types and the list of files from I guess my tests can be rewritten to make sure the tests are not machine dependent based on the files. |
* Set knownfiles for mimetypes to be empty list only during setup so that it doesn't leak into other tests. * Move the __main__ code to separate function for better testing.
I have moved the code for |
I am slightly confused since importing |
I resorted to using |
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.
LGTM! Thanks @tirkarthi
bpo-39299: Add more tests for mimetypes and its cli. (pythonGH-17949)
The change is safe to backport; please feel free to do it if you want. |
Thanks Andrew, I will add the labels and wait for the CI. |
Thanks @tirkarthi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thanks @tirkarthi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
* Add tests for case insensitive check of types and extensions as fallback. * Add tests for data url with no comma. * Add tests for read_mime_types. * Add tests for the mimetypes cli and refactor __main__ code to private function. * Restore mimetypes.knownfiles value at the end of the test. (cherry picked from commit d8efc14) Co-authored-by: Karthikeyan Singaravelan <[email protected]>
GH-17991 is a backport of this pull request to the 3.7 branch. |
* Add tests for case insensitive check of types and extensions as fallback. * Add tests for data url with no comma. * Add tests for read_mime_types. * Add tests for the mimetypes cli and refactor __main__ code to private function. * Restore mimetypes.knownfiles value at the end of the test. (cherry picked from commit d8efc14) Co-authored-by: Karthikeyan Singaravelan <[email protected]>
GH-17992 is a backport of this pull request to the 3.8 branch. |
I would prefer that a change like this not be backported to 3.7 at this stage of its lifecycle. It's not fixing any problems and, at worst, could add new ones. |
* Add tests for case insensitive check of types and extensions as fallback. * Add tests for data url with no comma. * Add tests for read_mime_types. * Add tests for the mimetypes cli and refactor __main__ code to private function. * Restore mimetypes.knownfiles value at the end of the test.
* Add tests for case insensitive check of types and extensions as fallback. * Add tests for data url with no comma. * Add tests for read_mime_types. * Add tests for the mimetypes cli and refactor __main__ code to private function. * Restore mimetypes.knownfiles value at the end of the test. (cherry picked from commit d8efc14) Co-authored-by: Karthikeyan Singaravelan <[email protected]>
read_mime_types
.https://bugs.python.org/issue39299