Exemplo n.º 1
0
def test_get_response_error():
    error = ValueError("test-error")
    expected_response = {
        "statusCode": "400",
        "body": str(error),
        "headers": {
            "Content-Type": "application/json",
        },
    }
    actual_response = Squrl.get_response(error=error)

    assert expected_response == actual_response
Exemplo n.º 2
0
def test_get_response_ok():
    response = "test-body"
    expected_response = {
        "statusCode": "200",
        "body": json.dumps(response),
        "headers": {
            "Content-Type": "application/json",
        },
    }
    actual_response = Squrl.get_response(response=response)

    assert expected_response == actual_response