(self)
| 1049 | self.assertStartsWith(sock.data, expected) |
| 1050 | |
| 1051 | def test_send(self): |
| 1052 | expected = b'this is a test this is only a test' |
| 1053 | conn = client.HTTPConnection('example.com') |
| 1054 | sock = FakeSocket(None) |
| 1055 | conn.sock = sock |
| 1056 | conn.send(expected) |
| 1057 | self.assertEqual(expected, sock.data) |
| 1058 | sock.data = b'' |
| 1059 | conn.send(array.array('b', expected)) |
| 1060 | self.assertEqual(expected, sock.data) |
| 1061 | sock.data = b'' |
| 1062 | conn.send(io.BytesIO(expected)) |
| 1063 | self.assertEqual(expected, sock.data) |
| 1064 | |
| 1065 | def test_send_updating_file(self): |
| 1066 | def data(): |
nothing calls this directly
no test coverage detected