def test5(self): lst = LinkedList(1, 2, 3, 4, 5) n = lst.get_node(3) lst.get_node(5).next = n self.assertEqual(is_circular(lst), True) lst1 = LinkedList(1, 2, 3, 4) self.assertEqual(is_circular(lst1), False)
def test3(self): lst = LinkedList(1, 1, 3, 1, 1) n = lst.get_node(3) remove_node_from_middle(n) required = LinkedList(1, 1, 1, 1) self.assertEqual(lst, required)