예제 #1
0
def test_get_error_need_raise_error_on_non_error_input():
    execute_command_results = [{
        "Type": entryTypes["note"],
        "ContentsFormat": formats["text"],
        "Contents": "this is not an error"
    }]
    with pytest.raises(ValueError) as exception:
        get_error(execute_command_results)

    assert "execute_command_result has no error entry. before using get_error use is_error" in str(
        exception)
예제 #2
0
def test_get_error():
    execute_command_results = [{
        "Type": entryTypes["error"],
        "ContentsFormat": formats["text"],
        "Contents": "this is error message"
    }]
    error = get_error(execute_command_results)
    assert error == "this is error message"