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