(self)
| 507 | self.assertEqual(self._parse_chunked(body), self.expected_body) |
| 508 | |
| 509 | def test_request(self): |
| 510 | for empty_lines in (False, True,): |
| 511 | conn = client.HTTPConnection('example.com') |
| 512 | conn.sock = FakeSocket(b'') |
| 513 | conn.request( |
| 514 | 'POST', '/', self._make_body(empty_lines=empty_lines)) |
| 515 | |
| 516 | _, headers, body = self._parse_request(conn.sock.data) |
| 517 | body = self._parse_chunked(body) |
| 518 | self.assertEqual(body, self.expected_body) |
| 519 | self.assertEqual(headers['Transfer-Encoding'], 'chunked') |
| 520 | |
| 521 | # Content-Length and Transfer-Encoding SHOULD not be sent in the |
| 522 | # same request |
| 523 | self.assertNotIn('content-length', [k.lower() for k in headers]) |
| 524 | |
| 525 | def test_empty_body(self): |
| 526 | # Zero-length iterable should be treated like any other iterable |
nothing calls this directly
no test coverage detected