Exemple #1
0
def test_build_response_error_2():
    response = Response()
    response.status_code = 200
    response.headers = None
    response.set_body('{"hello": "world"}')

    with pytest.raises(Exception, match=r'Response not well formed'):
        response._build_response()
Exemple #2
0
def test_build_response_error_1():
    response = Response()
    response.status_code = 0
    response.set_header('x-app', 'blargh!')
    response.set_body('{"hello": "world"}')

    with pytest.raises(Exception, match=r'Response not well formed'):
        response._build_response()