def test_delete_at_index_emtpy_list(self): l = LinkedList() with self.assertRaises(RuntimeError): l.deleteAtIndex(0)
def test_delete_at_index_out_of_bound(self): l = LinkedList([1, 2, 3]) with self.assertRaises(RuntimeError): l.deleteAtIndex(7)
def test_delete_at_index(self): l = LinkedList([1, 2, 3]) l.deleteAtIndex(1) self.assertEqual(l.to_python_list(), [1, 3])