def test_printProgressBarNoProgress(self):
"""
L{StdioClient._printProgressBar} prints a progress description that
indicates 0 bytes transferred if no bytes have been transferred and no
time has passed.
"""
self.setKnownConsoleSize(10, 34)
clock = self.client.reactor = Clock()
wrapped = BytesIO(b"x")
wrapped.name = b"sample"
wrapper = cftp.FileWrapper(wrapped)
startTime = clock.seconds()
self.client._printProgressBar(wrapper, startTime)
if _PY3:
result = b"\rb'sample' 0% 0.0B 0.0Bps 00:00 "
else:
result = "\rsample 0% 0.0B 0.0Bps 00:00 "
self.assertEqual(self.client.transport.value(), result)
评论列表
文章目录