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

Method test_idle_delayed_packet

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

Source from the content-addressed store, hash-verified

606 self.assertEqual(data, [b'1', b'9'])
607
608 def test_idle_delayed_packet(self):
609 client, _ = self._setup(IdleCmdDelayedPacketHandler)
610 client.login('user', 'pass')
611 # If our readline() implementation fails to preserve line fragments
612 # when idle timeouts trigger, a response spanning delayed packets
613 # can be corrupted, leaving the protocol stream in a bad state.
614 try:
615 with client.idle(0.5) as idler:
616 self.assertRaises(StopIteration, next, idler)
617 except client.abort as err:
618 self.fail('multi-packet response was corrupted by idle timeout')
619
620 def test_login(self):
621 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