MCPcopy Index your code
hub / github.com/python-websockets/websockets / test_one_input

Function test_one_input

fuzzing/fuzz_http11_request_parser.py:12–33  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

10
11
12def test_one_input(data):
13 reader = StreamReader()
14 reader.feed_data(data)
15 reader.feed_eof()
16
17 parser = Request.parse(
18 reader.read_line,
19 )
20
21 try:
22 next(parser)
23 except StopIteration as exc:
24 assert isinstance(exc.value, Request)
25 return # input accepted
26 except (
27 EOFError, # connection is closed without a full HTTP request
28 SecurityError, # request exceeds a security limit
29 ValueError, # request isn't well formatted
30 ):
31 return # input rejected with a documented exception
32
33 raise RuntimeError("parsing didn't complete")
34
35
36def main():

Callers

nothing calls this directly

Calls 4

feed_dataMethod · 0.95
feed_eofMethod · 0.95
StreamReaderClass · 0.90
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…