We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ba2aee commit 819491fCopy full SHA for 819491f
1 file changed
Lib/http/server.py
@@ -900,8 +900,8 @@ def guess_type(self, path):
900
>>> testhandler.default_content_type = 'nonesuch/nonesuch'
901
>>> testhandler.guess_type('/this/should/give/default')
902
'nonesuch/nonesuch'
903
- >>> # check short-circuiting works
904
- >>> mimetypes = type('', (), {
+ >>> # check short-circuiting works using mock mimetypes.guess_type
+ >>> sys.modules[__name__].mimetypes = type('', (), {
905
... 'guess_type': lambda x: (print('foo'), print('bar'))
906
... })
907
>>> testhandler.guess_type('/should/show/foo/bar/then/default')
0 commit comments