from MyQueue import MyQueue
import unittest
class test_MyQueue(unittest.TestCase):
def setup(self):
self.q1 = Queue()
self.q2 = Queue([1,2,3])
def test_queue_init(self):
self.assertIsNone(self.q1.peek(),"q1's head of queue is None")
self.assertIsNotNone(self.q2.peek(),"q2's head of queue is not None")
self.assertEqual(self.q2.peek(),1,"q2.peek() == 1")
self.assertEqual(self.q1.size(),0)
self.assertEqual(self.q2.size(),3)
def test_queue_enqueue(self):
self.q1.enqueue(10)
self.assertEqual(self.q1.size(),1)