DEV Community

loading...

Discussion on: Implement a Queue using a List.

Collapse
codewithml profile image
CodeWithML Author

I'm assuming you didn't add the second argument.

def main():
    test = TestQueueList()
    queue1 = Queue()
    queue1.enqueue(5)
    test.assertEqual(queue1.size()) 

The second argument required will be the value returned by the function size.
assertEqual compares two values, if both match then the test case will pass, otherwise it will fail.
You should write it like this, in main function

def main():
    test = TestQueueList()
   # Testing inside main function
    queue1 = Queue()
    queue1.enqueue(5)
    test.assertEqual(queue1.size(), 1) 

This will work.