def test(self): """Testing linked list""" linked_list = LinkedList() linked_list.push_back(1) linked_list.push_back(2) linked_list.push_back(3) self.assertFalse(linked_list.empty()) self.assertEqual(linked_list.pop_front(), 1) self.assertEqual(linked_list.pop_front(), 2) self.assertEqual(linked_list.pop_front(), 3) self.assertTrue(linked_list.empty())
def test(self): """Testing linked list""" linked_list = LinkedList() linked_list.push_back(1) linked_list.push_back("foo") linked_list.push_back([3, 2, 1]) self.assertFalse(linked_list.empty()) self.assertEqual(linked_list.pop_back(), [3, 2, 1]) self.assertEqual(linked_list.pop_back(), "foo") self.assertEqual(linked_list.pop_back(), 1) self.assertTrue(linked_list.empty())