def test_linkedlist1(self): _list = LinkedListElements() self.assertTrue(_list.is_empty()) _list.add(1) self.assertEqual(1, _list.get_head()) self.assertFalse(_list.is_empty()) self.assertEqual(1, _list.remove())
def test_linkedlist2(self): _list = LinkedListElements() self.assertTrue(_list.is_empty()) _list.add(1) _list.add(2) _list.add(3) self.assertEqual(3, _list.get_head()) self.assertEqual(3, _list.remove()) self.assertEqual(2, _list.get_head())
def __init__(self): self.list = LinkedListElements()