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

Method test_storbinary

Lib/test/test_ftplib.py:614–623  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

612 self.check_data(''.join(received), RETR_DATA.replace('\r\n', ''))
613
614 def test_storbinary(self):
615 f = io.BytesIO(RETR_DATA.encode(self.client.encoding))
616 self.client.storbinary('stor', f)
617 self.check_data(self.server.handler_instance.last_received_data,
618 RETR_DATA.encode(self.server.encoding))
619 # test new callback arg
620 flag = []
621 f.seek(0)
622 self.client.storbinary('stor', f, callback=lambda x: flag.append(None))
623 self.assertTrue(flag)
624
625 def test_storbinary_rest(self):
626 data = RETR_DATA.replace('\r\n', '\n').encode(self.client.encoding)

Callers 1

test_encoding_paramMethod · 0.95

Calls 6

check_dataMethod · 0.95
seekMethod · 0.95
storbinaryMethod · 0.80
assertTrueMethod · 0.80
encodeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected