mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Fix BytesWarning with -bb in wsgiref.headers.Headers.
This commit is contained in:
parent
35b7e837ab
commit
a9ecbdade7
2 changed files with 8 additions and 3 deletions
|
@ -426,15 +426,20 @@ class HeaderTests(TestCase):
|
|||
|
||||
h[b"Foo"] = bytes(b"bar")
|
||||
self.assertEqual("bar", h.get("Foo"))
|
||||
self.assertEqual("bar", h.get(b"Foo"))
|
||||
|
||||
h.setdefault(b"Bar", b"foo")
|
||||
self.assertEqual("foo", h.get("Bar"))
|
||||
self.assertEqual("foo", h.get(b"Bar"))
|
||||
|
||||
h.add_header(b'content-disposition', b'attachment',
|
||||
filename=b'bud.gif')
|
||||
self.assertEqual('attachment; filename="bud.gif"',
|
||||
h.get("content-disposition"))
|
||||
|
||||
del h['content-disposition']
|
||||
self.assert_(b'content-disposition' not in h)
|
||||
|
||||
|
||||
class ErrorHandler(BaseCGIHandler):
|
||||
"""Simple handler subclass for testing BaseHandler"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue