def test_full_queue(self): queue = self._make_queue(key=0x5ca1ab1e) with self.assertRaises(events.queue.QueueFullError): # we can't control the sysctl for max queue length but we can be # sure that if we keep throwing stuff in there it'll fill up # eventually while True: queue.put("Example" * 100)
def test_consume_with_items(self): queue = self._make_queue(key=0x5ca1ab1e) queue.put("example") iterator = queue.consume() item = iterator.next() self.assertEqual(item, "example")
def test_put_message(self): queue = self._make_queue(key=0x5ca1ab1e) input = "Test" queue.put(input) output, msgtype = queue.queue.receive(block=False) self.assertEqual(input, output)