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

Method test_optional_cr

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

Source from the content-addressed store, hash-verified

484 self.assertEqual(expected, list(headers.get_all()))
485
486 def test_optional_cr(self):
487 # Bare CR is not a valid line separator
488 with self.assertRaises(HTTPInputError):
489 HTTPHeaders.parse("CRLF: crlf\r\nLF: lf\nCR: cr\rMore: more\r\n")
490
491 # Both CRLF and LF should be accepted as separators. CR should not be
492 # part of the data when followed by LF.
493 headers = HTTPHeaders.parse("CRLF: crlf\r\nLF: lf\nMore: more\r\n")
494 self.assertEqual(
495 sorted(headers.get_all()),
496 [("Crlf", "crlf"), ("Lf", "lf"), ("More", "more")],
497 )
498
499 def test_copy(self):
500 all_pairs = [("A", "1"), ("A", "2"), ("B", "c")]

Callers

nothing calls this directly

Calls 2

get_allMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected