MCPcopy Create free account
hub / github.com/python-websockets/websockets / test_parse_body_too_large

Method test_parse_body_too_large

tests/test_http11.py:232–239  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

230 self.assertEqual(response.body, b"Hello world!\n")
231
232 def test_parse_body_too_large(self):
233 self.reader.feed_data(b"HTTP/1.1 200 OK\r\n\r\n" + b"a" * 1048577)
234 with self.assertRaises(SecurityError) as raised:
235 next(self.parse())
236 self.assertEqual(
237 str(raised.exception),
238 "body too large: over 1048576 bytes",
239 )
240
241 def test_parse_body_with_content_length(self):
242 self.reader.feed_data(

Callers

nothing calls this directly

Calls 2

parseMethod · 0.95
feed_dataMethod · 0.45

Tested by

no test coverage detected