(self)
| 1063 | self.assertEqual(expected, sock.data) |
| 1064 | |
| 1065 | def test_send_updating_file(self): |
| 1066 | def data(): |
| 1067 | yield 'data' |
| 1068 | yield None |
| 1069 | yield 'data_two' |
| 1070 | |
| 1071 | class UpdatingFile(io.TextIOBase): |
| 1072 | mode = 'r' |
| 1073 | d = data() |
| 1074 | def read(self, blocksize=-1): |
| 1075 | return next(self.d) |
| 1076 | |
| 1077 | expected = b'data' |
| 1078 | |
| 1079 | conn = client.HTTPConnection('example.com') |
| 1080 | sock = FakeSocket("") |
| 1081 | conn.sock = sock |
| 1082 | conn.send(UpdatingFile()) |
| 1083 | self.assertEqual(sock.data, expected) |
| 1084 | |
| 1085 | |
| 1086 | def test_send_iter(self): |
nothing calls this directly
no test coverage detected