예제 #1
0
def test_parse_request_body():
    core = HTTPrettyRequest(headers="test test HTTP/1.1")

    qs = "test"
    response = core.parse_request_body(qs)

    assert response == "test"
예제 #2
0
def test_parse_request_body():
    core = HTTPrettyRequest(headers='test test HTTP/1.1')

    qs = 'test'
    response = core.parse_request_body(qs)

    assert response == 'test'
예제 #3
0
def test_parse_querystring():

    core = HTTPrettyRequest(headers="test test HTTP/1.1")

    qs = "test test"
    response = core.parse_querystring(qs)

    assert response == {}
예제 #4
0
def test_parse_querystring():

    core = HTTPrettyRequest(headers='test test HTTP/1.1')

    qs = 'test test'
    response = core.parse_querystring(qs)

    assert response == {}
예제 #5
0
def test_parse_querystring( mock_get):
    mock_resp = _mock_response(status=500, raise_for_status=HTTPError("google is down"))
    mock_get.return_value = mock_resp


    headers = 'User-Agent=Boto3/1.9.90 Python/3.6.0 Darwin/18.2.0 Botocore/1.12.90'
    core = HTTPrettyRequest(headers=headers)