(self)
| 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 | |
| 510 | class ErrorHandler(BaseCGIHandler): |
| 511 | """Simple handler subclass for testing BaseHandler""" |
nothing calls this directly
no test coverage detected