def test_return_string(): string1 = "1,2,3,4,6;5" clean_list, x = parse_input(string1) final_list = find_pairs(clean_list, x) assert return_string(final_list) == '1,4;2,3' string2 = '2,4,5,6,9,11,15;20' clean_list, x = parse_input(string2) final_list = find_pairs(clean_list, x) assert return_string(final_list) == '5,15;9,11' string3 = '1,2,3,4;50' clean_list, x = parse_input(string3) final_list = find_pairs(clean_list, x) assert return_string(final_list) == 'NULL'
def test_parse_input(): string1 = "1,2,3,4,6;5" first, second = parse_input(string1) assert first == [1, 2, 3, 4, 6] assert second == 5
def test_number_pairs(): string1 = "1,2,3,4,6;5" clean_list, x = parse_input(string1) assert find_pairs(clean_list, x) == [(1, 4), (2, 3)]