(self)
| 1017 | self.assertEqual(expected, sock.data) |
| 1018 | |
| 1019 | def test_send_updating_file(self): |
| 1020 | def data(): |
| 1021 | yield 'data' |
| 1022 | yield None |
| 1023 | yield 'data_two' |
| 1024 | |
| 1025 | class UpdatingFile(io.TextIOBase): |
| 1026 | mode = 'r' |
| 1027 | d = data() |
| 1028 | def read(self, blocksize=-1): |
| 1029 | return next(self.d) |
| 1030 | |
| 1031 | expected = b'data' |
| 1032 | |
| 1033 | conn = client.HTTPConnection('example.com') |
| 1034 | sock = FakeSocket("") |
| 1035 | conn.sock = sock |
| 1036 | conn.send(UpdatingFile()) |
| 1037 | self.assertEqual(sock.data, expected) |
| 1038 | |
| 1039 | |
| 1040 | def test_send_iter(self): |
nothing calls this directly
no test coverage detected