Esempio n. 1
0
def linked_list_test_44():
    s = "Pruebo hacer un index de una lista con elementos repetidos"
    value_1 = "Senna"
    try:
        test_list = LinkedList()
        many_append(test_list, value_1, 10)
        indice = test_list.index(value_1)
        test.print_test(s, indice == 0)
    except Exception as err:
        error_by_except(s, err)
Esempio n. 2
0
def linked_list_test_27():
    s = "Hago un index de una lista de 1000 elementos"
    try:
        test_list = LinkedList()
        value_1 = "!"
        value_2 = "F"
        many_append(test_list, value_1, 999)
        append(test_list, value_2)
        correct_index = 999
        test_index = test_list.index(value_2)
        test.print_test(s, test_index == correct_index)
    except Exception as err:
        error_by_except(s, err)
Esempio n. 3
0
def linked_list_test_15():
    s = "Pruebo hacer un index de un elemento que existe"
    value_1 = "El 8N es la fiesta de medios"
    value_2 = "El 8N es la fiesta de gestion"
    try:
        test_list = LinkedList()
        many_append(test_list, value_1, 10)
        append(test_list, value_2)
        index_1 = test_list.index(value_1)
        index_2 = test_list.index(value_2)
        test.print_test(s, index_1 == 0 and index_2 == 10)
    except Exception as err:
        error_by_except(s, err)
Esempio n. 4
0
def linked_list_test_16():
    s = "Pruebo hacer un index de un elemento que no existe"
    value_1 = "El 8N es la fiesta de medios"
    value_2 = "El 8N es la fiesta de gestion"
    try:
        test_list = LinkedList()
        many_append(test_list, value_1, 10)
        append(test_list, value_2)
        was_error_thrown = False

        index = test_list.index("El 8N es la fiesta de gestion de tic")
        was_error_thrown = not index
        test.print_test(s, was_error_thrown)
    except Exception as err:
        error_by_except(s, err)