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

Method test_serialize_with_body

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

Source from the content-addressed store, hash-verified

375 )
376
377 def test_serialize_with_body(self):
378 response = Response(
379 200,
380 "OK",
381 Headers([("Content-Length", "13"), ("Content-Type", "text/plain")]),
382 b"Hello world!\n",
383 )
384 self.assertEqual(
385 response.serialize(),
386 b"HTTP/1.1 200 OK\r\n"
387 b"Content-Length: 13\r\n"
388 b"Content-Type: text/plain\r\n"
389 b"\r\n"
390 b"Hello world!\n",
391 )
392
393
394class HeadersTests(GeneratorTestCase):

Callers

nothing calls this directly

Calls 3

serializeMethod · 0.95
HeadersClass · 0.90
ResponseClass · 0.85

Tested by

no test coverage detected