MCPcopy Index your code
hub / github.com/RustPython/RustPython / testExtras

Method testExtras

Lib/test/test_wsgiref.py:492–508  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

490 self.assertRaises(TypeError, Headers, "foo")
491
492 def testExtras(self):
493 h = Headers()
494 self.assertEqual(str(h),'\r\n')
495
496 h.add_header('foo','bar',baz="spam")
497 self.assertEqual(h['foo'], 'bar; baz="spam"')
498 self.assertEqual(str(h),'foo: bar; baz="spam"\r\n\r\n')
499
500 h.add_header('Foo','bar',cheese=None)
501 self.assertEqual(h.get_all('foo'),
502 ['bar; baz="spam"', 'bar; cheese'])
503
504 self.assertEqual(str(h),
505 'foo: bar; baz="spam"\r\n'
506 'Foo: bar; cheese\r\n'
507 '\r\n'
508 )
509
510class ErrorHandler(BaseCGIHandler):
511 """Simple handler subclass for testing BaseHandler"""

Callers

nothing calls this directly

Calls 5

add_headerMethod · 0.95
get_allMethod · 0.95
HeadersClass · 0.90
strFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected