mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-39299: Add more tests for mimetypes and its cli. (GH-17949)
* 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.
This commit is contained in:
parent
c1ee6e5e9b
commit
d8efc14951
2 changed files with 85 additions and 5 deletions
|
@ -564,7 +564,7 @@ def _default_mime_types():
|
|||
_default_mime_types()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def _main():
|
||||
import getopt
|
||||
|
||||
USAGE = """\
|
||||
|
@ -608,3 +608,7 @@ More than one type argument may be given.
|
|||
guess, encoding = guess_type(gtype, strict)
|
||||
if not guess: print("I don't know anything about type", gtype)
|
||||
else: print('type:', guess, 'encoding:', encoding)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
_main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue