def test_delete_index_5_many_element_list(self): linked = LinkedList(['one', 'two', 3, 4]) with self.assertRaises(OutOfRangeError): linked.delete_at_index(5)
def test_delete_index_3_many_element_list(self): linked = LinkedList(['one', 'two', 3, 4]) linked.delete_at_index(3) self.assertEqual("| one | -> | two | -> | 3 | -> None", str(linked))
def test_delete_index_0_one_element_list(self): linked = LinkedList(['one']) linked.delete_at_index(0) self.assertEqual(None, linked.first_node)
def test_delete_index_1_one_element_list(self): linked = LinkedList(['one']) with self.assertRaises(OutOfRangeError): linked.delete_at_index(1)
def test_delete_index_1_empty_list(self): linked = LinkedList([]) with self.assertRaises(OutOfRangeError): linked.delete_at_index(1)