コード例 #1
0
def get_solution(problem_str, corrects, incorrects):
    solution = corrects.get(problem_str)
    if solution:
        print(f"Known solution {problem_str} : {solution}")
    else:
        solution = cafeize(problem_str)
        if solution in incorrects[problem_str]:
            print(f"Known incorrect {problem_str} : {solution}")
            solution = None
        else:
            print(f"New problem {problem_str} : {solution}")
    return solution
コード例 #2
0
def test_wrong_results(input_str, unexpected_str):
    assert cafeize(input_str) != unexpected_str.lower()
コード例 #3
0
def test_cafe18(input_str, expected_str):
    assert cafeize(input_str) == expected_str.lower()
コード例 #4
0
def test_incorrect_generated(input_str, unexpected_str):
    output = cafeize(input_str)
    assert output != unexpected_str.lower()
コード例 #5
0
def test_correct_generated(input_str, expected_str):
    assert cafeize(input_str) == expected_str.lower()