def test_msg_dont_treated(self): self._mock_pika() napi = Napi() data = self._open_message()[0:1] self._mock_consumer(data) napi._treat_message = Mock(return_value=False) with self.assertRaises(StopIteration): napi.next_message()
def test_ignore_get_messages(self): self._mock_pika() self._mock_pool() data = self._open_message()[3:] self._mock_consumer(data) napi = Napi() with self.assertRaises(StopIteration): msg = napi.next_message()