def test_queue_instantiation(self): # Arrange queue = Queue() # Act, Assert assert queue.maxsize == 0 assert queue.qsize() == 0 assert queue.empty() assert not queue.full()
def test_queue_instantiation(self): # Arrange queue = Queue() # Act # Assert self.assertEqual(0, queue.maxsize) self.assertEqual(0, queue.qsize()) self.assertTrue(queue.empty()) self.assertFalse(queue.full())
def test_put_to_maxlen_makes_queue_full(self): # Arrange queue = Queue(maxsize=5) # Act queue.put_nowait("A") queue.put_nowait("B") queue.put_nowait("C") queue.put_nowait("D") queue.put_nowait("E") # Assert assert queue.qsize() == 5 assert queue.full()
def test_put_to_maxlen_makes_queue_full(self): # Arrange queue = Queue(maxsize=5) # Act queue.put_nowait("A") queue.put_nowait("B") queue.put_nowait("C") queue.put_nowait("D") queue.put_nowait("E") # Assert self.assertEqual(5, queue.qsize()) self.assertTrue(queue.full())