MCPcopy
hub / github.com/tornadoweb/tornado / test_invalid_header_names

Method test_invalid_header_names

tornado/test/httputil_test.py:545–559  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

543 self.assertEqual(headers, headers2)
544
545 def test_invalid_header_names(self):
546 invalid_names = [
547 "",
548 "foo bar",
549 "foo\tbar",
550 "foo\nbar",
551 "foo\x00bar",
552 "foo ",
553 " foo",
554 "é",
555 ]
556 for name in invalid_names:
557 headers = HTTPHeaders()
558 with self.assertRaises(HTTPInputError):
559 headers.add(name, "bar")
560
561 def test_linear_performance(self):
562 def f(n):

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
HTTPHeadersClass · 0.90

Tested by

no test coverage detected