MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / test_parse_query_method

Function test_parse_query_method

tests/test_http_parser.py:751–763  ·  view source on GitHub ↗

QUERY has the highest llhttp method id; both parsers must decode its name. Regression test for a stale hand-maintained method count in the C parser that mapped the last method(s) to " ".

(parser: HttpRequestParser)

Source from the content-addressed store, hash-verified

749
750
751def test_parse_query_method(parser: HttpRequestParser) -> None:
752 """QUERY has the highest llhttp method id; both parsers must decode its name.
753
754 Regression test for a stale hand-maintained method count in the C parser
755 that mapped the last method(s) to "<unknown>".
756 """
757 text = b"QUERY /test HTTP/1.1\r\nHost: a\r\n\r\n"
758 messages, upgrade, tail = parser.feed_data(text)
759 assert len(messages) == 1
760 msg = messages[0][0]
761 assert msg.method == "QUERY"
762 assert msg.path == "/test"
763 assert msg.version == (1, 1)
764
765
766async def test_parse_body(parser: HttpRequestParser) -> None:

Callers

nothing calls this directly

Calls 1

feed_dataMethod · 0.45

Tested by

no test coverage detected