コード例 #1
0
def test_error_5XX_status_code_message():
    response = Response()
    response.set_status_code(506)
    check = response.error_5XX('I\'m a variant!!!')
    assert check['statusCode'] == 506
    assert check['body'] == '{"message": "I\'m a variant!!!"}'
    assert check['headers']['Access-Control-Allow-Origin'] == '*'
コード例 #2
0
def test_error_5XX_message():
    response = Response()
    check = response.error_5XX('this is a system error')
    assert check['statusCode'] == 500
    assert check['body'] == '{"message": "this is a system error"}'
    assert check['headers']['Access-Control-Allow-Origin'] == '*'
コード例 #3
0
def test_error_5XX():
    response = Response()
    check = response.error_5XX()
    assert check['statusCode'] == 500
    assert check['body'] is None
    assert check['headers']['Access-Control-Allow-Origin'] == '*'