(self)
| 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 | |
| 394 | class HeadersTests(GeneratorTestCase): |