コード例 #1
0
def mock_request_with_json():
    r = HttpRequestImpl()
    r.method = 'POST'
    r.url = f"{MOCK_URL}?{MOCK_QUERY_STRING}"
    r.headers['Content-Type'] = 'Application/JSON'
    r.params['message'] = MOCK_JSON
    r.body = MOCK_JSON
    return r
コード例 #2
0
def mock_request_with_json():
    r = HttpRequestImpl()
    r.method = "POST"
    r.url = f"{MOCK_URL}?{MOCK_QUERY_STRING}"
    r.headers["Content-Type"] = "Application/JSON"
    r.params["message"] = MOCK_JSON
    r.body = MOCK_JSON
    return r
コード例 #3
0
def test_body():
    r = HttpRequestImpl()
    r.body = MOCK_JSON
    assert r.body == MOCK_JSON