def test_7(self): """ test remove(node) """ l = LinkedList() n1 = Node(1) n2 = Node(2) n3 = Node(3) l.append(n1) l.append(n2) l.append(n3) l.remove(2) self.assertEqual(n1._next._value, 3)
def test_6(self): """ test remove(node) for no matching node """ l = LinkedList() n1 = Node(1) n2 = Node(2) n3 = Node(3) l.append(n1) l.append(n2) l.append(n3) self.assertEqual(l.remove(7), "Error: Node does not exist!")