def test_is_empty_true(self): #testing if queue is empty print("\n") q = lab1.Queue() self.assertTrue(q.isEmpty()) print("\n")
def test_dequeue_empty(self): #testing dequeue operation with empty queue print("\n") q = lab1.Queue() self.assertEqual(q.dequeue(), None) print("\n")
def test_is_empty_false(self): #testing if queue is empty print("\n") s = lab1.Queue() s.enqueue("4") print("return false if the queue is not empty") self.assertEqual(s.isEmpty(), False) print("\n")
def test_is_empty_false(self): #testing if queue is empty print("\n") q = lab1.Queue() q.enqueue(1) self.assertFalse(q.isEmpty()) print("\n")
def test_dequeue(self): #testing the basic enqueue operation print("\n") print("Testing Queue : Returning Empty Queue") q = lab1.Queue() q.enqueue(1) q.dequeue() self.assertEqual(q.printQueue(), []) print("\n")
def test_basic_enqueue(self): #testing the basic enqueue operation print("\n") print("Testing Queue : Enqueue") q = lab1.Queue() q.enqueue(1) q.enqueue(2) q.enqueue(3) q.enqueue(4) self.assertEqual(q.printQueue(), [1,2,3,4]) print("\n")
def test_enter_dequeque(self): print() print("Testing enter and de...") ss = 'abcde' q = lab1.Queue() for s in ss: q.enqueue(s) res = '' while not q.isEmpty(): res += q.dequeue() self.assertEqual(res, ss)
def test_basic_dequeue(self): #testing the basic dequeue operation print("\n") q = lab1.Queue() q.enqueue(1) q.enqueue(2) q.enqueue(3) q.enqueue(4) self.assertEqual(q.dequeue(), 1) print("\n")
def test_enqueue_dequeue(self): #testing enqueue dequeue operation print("\n") q = lab1.Queue() q.enqueue(1) q.enqueue(2) q.enqueue(3) q.enqueue(4) q.dequeue() self.assertEqual(q.printQueue(), [2,3,4]) print("\n")
def test_empty_enqueue(self): #testing the basic enqueue operation print("\n") print("Testing empty Queue : Empty") q = lab1.Queue() self.assertEqual(q.isEmpty(), True) self.assertIsNone(q.dequeue()) data = 1 q.enqueue(data) _data = q.dequeue() self.assertEqual(q.isEmpty(), True) self.assertIsNone(q.dequeue()) self.assertEqual(data, _data)
def test_print_empty_queue(self): print("\n") q = lab1.Queue() self.assertEqual(q.printQueue(), []) print("\n")