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

Method test_idle_delayed_packet

Lib/test/test_imaplib.py:615–625  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

613 self.assertEqual(data, [b'1', b'9'])
614
615 def test_idle_delayed_packet(self):
616 client, _ = self._setup(IdleCmdDelayedPacketHandler)
617 client.login('user', 'pass')
618 # If our readline() implementation fails to preserve line fragments
619 # when idle timeouts trigger, a response spanning delayed packets
620 # can be corrupted, leaving the protocol stream in a bad state.
621 try:
622 with client.idle(0.5) as idler:
623 self.assertRaises(StopIteration, next, idler)
624 except client.abort as err:
625 self.fail('multi-packet response was corrupted by idle timeout')
626
627 def test_login(self):
628 client, _ = self._setup(SimpleIMAPHandler)

Callers

nothing calls this directly

Calls 5

_setupMethod · 0.95
idleMethod · 0.80
loginMethod · 0.45
assertRaisesMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected