| 595 | self.assertEqual(data[1], b'9') |
| 596 | |
| 597 | def test_idle_burst(self): |
| 598 | client, _ = self._setup(IdleCmdHandler) |
| 599 | client.login('user', 'pass') |
| 600 | # burst() should yield immediately available responses |
| 601 | with client.idle() as idler: |
| 602 | batch = list(idler.burst()) |
| 603 | self.assertEqual(len(batch), 4) |
| 604 | # burst() should not have consumed later responses |
| 605 | _, data = client.response('RECENT') |
| 606 | self.assertEqual(data, [b'1', b'9']) |
| 607 | |
| 608 | def test_idle_delayed_packet(self): |
| 609 | client, _ = self._setup(IdleCmdDelayedPacketHandler) |