MCPcopy Index your code
hub / github.com/python/cpython / testExtras

Method testExtras

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

Source from the content-addressed store, hash-verified

486 self.assertRaises(TypeError, Headers, "foo")
487
488 def testExtras(self):
489 h = Headers()
490 self.assertEqual(str(h),'\r\n')
491
492 h.add_header('foo','bar',baz="spam")
493 self.assertEqual(h['foo'], 'bar; baz="spam"')
494 self.assertEqual(str(h),'foo: bar; baz="spam"\r\n\r\n')
495
496 h.add_header('Foo','bar',cheese=None)
497 self.assertEqual(h.get_all('foo'),
498 ['bar; baz="spam"', 'bar; cheese'])
499
500 self.assertEqual(str(h),
501 'foo: bar; baz="spam"\r\n'
502 'Foo: bar; cheese\r\n'
503 '\r\n'
504 )
505
506 def testRaisesControlCharacters(self):
507 for c0 in control_characters_c0():

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