Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-39299: Add more tests for mimetypes and its cli. #17949
Conversation
This comment has been minimized.
This comment has been minimized.
|
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.
This comment has been minimized.
This comment has been minimized.
|
I have moved the code for |
This comment has been minimized.
This comment has been minimized.
|
I am slightly confused since importing |
This comment has been minimized.
This comment has been minimized.
|
I resorted to using |
|
LGTM! Thanks @tirkarthi |
bpo-39299: Add more tests for mimetypes and its cli. (pythonGH-17949)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The change is safe to backport; please feel free to do it if you want. |
This comment has been minimized.
This comment has been minimized.
|
Thanks Andrew, I will add the labels and wait for the CI. |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jan 13, 2020
|
Thanks @tirkarthi for the PR |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jan 13, 2020
|
Thanks @tirkarthi for the PR |
* 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]>
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 13, 2020
|
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]>
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 13, 2020
|
GH-17992 is a backport of this pull request to the 3.8 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.
* 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.
tirkarthi commentedJan 11, 2020
•
edited by bedevere-bot
read_mime_types.https://bugs.python.org/issue39299