MCPcopy Index your code
hub / github.com/python/cpython / test_send_updating_file

Method test_send_updating_file

Lib/test/test_httplib.py:1065–1083  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 4

sendMethod · 0.95
UpdatingFileClass · 0.85
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected