MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_send_updating_file

Method test_send_updating_file

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

Source from the content-addressed store, hash-verified

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

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