def setUp(self):
     self.linked_list = LinkedList()
     third_node = LinkedListNode(None, 3)
     second_node = LinkedListNode(third_node, 2)
     first_node = LinkedListNode(second_node, 1)
     self.linked_list = LinkedList()
     self.linked_list.head = first_node
    def setUp(self):
        linked_list = LinkedList()
        linked_list.add(3)
        linked_list.add(2)
        linked_list.add(1)
        linked_list.add(0)

        linked_list.append(4)
        linked_list.append(5)
        linked_list.append(6)
        linked_list.append(7)

        linked_list.remove_first()  # remove 0
        linked_list.remove_last()  # remove 7

        self.linked_list = linked_list
 def test_remove_node_with_empty_tree(self):
     self.linked_list = LinkedList()
     with self.assertRaises(AttributeError):
         self.linked_list.remove_first()
 def setUp(self):
     self.linked_list = LinkedList()
     self.linked_list.head = LinkedListNode(None, 2)
 def setUp(self):
     self.linked_list = LinkedList()