(self)
| 1003 | self.assertStartsWith(sock.data, expected) |
| 1004 | |
| 1005 | def test_send(self): |
| 1006 | expected = b'this is a test this is only a test' |
| 1007 | conn = client.HTTPConnection('example.com') |
| 1008 | sock = FakeSocket(None) |
| 1009 | conn.sock = sock |
| 1010 | conn.send(expected) |
| 1011 | self.assertEqual(expected, sock.data) |
| 1012 | sock.data = b'' |
| 1013 | conn.send(array.array('b', expected)) |
| 1014 | self.assertEqual(expected, sock.data) |
| 1015 | sock.data = b'' |
| 1016 | conn.send(io.BytesIO(expected)) |
| 1017 | self.assertEqual(expected, sock.data) |
| 1018 | |
| 1019 | def test_send_updating_file(self): |
| 1020 | def data(): |
nothing calls this directly
no test coverage detected