(self)
| 461 | self.assertEqual(self._parse_chunked(body), self.expected_body) |
| 462 | |
| 463 | def test_request(self): |
| 464 | for empty_lines in (False, True,): |
| 465 | conn = client.HTTPConnection('example.com') |
| 466 | conn.sock = FakeSocket(b'') |
| 467 | conn.request( |
| 468 | 'POST', '/', self._make_body(empty_lines=empty_lines)) |
| 469 | |
| 470 | _, headers, body = self._parse_request(conn.sock.data) |
| 471 | body = self._parse_chunked(body) |
| 472 | self.assertEqual(body, self.expected_body) |
| 473 | self.assertEqual(headers['Transfer-Encoding'], 'chunked') |
| 474 | |
| 475 | # Content-Length and Transfer-Encoding SHOULD not be sent in the |
| 476 | # same request |
| 477 | self.assertNotIn('content-length', [k.lower() for k in headers]) |
| 478 | |
| 479 | def test_empty_body(self): |
| 480 | # Zero-length iterable should be treated like any other iterable |
nothing calls this directly
no test coverage detected