def test_can_post_json_in_chunks(self): http = HTTP(b"httq.io:8080") http.post(b"/json?foo=bar") http.write(b"bum") http.write(b"ble") http.write(b"bee") http.write(b"") response = http.response() content = response.content assert content == {"method": "POST", "query": "foo=bar", "content": "bumblebee"}
def test_can_post_json_in_chunks(self): http = HTTP(b"httq.io:8080") http.post(b"/json?foo=bar") http.write(b"bum") http.write(b"ble") http.write(b"bee") http.write(b"") response = http.response() content = response.content assert content == { "method": "POST", "query": "foo=bar", "content": "bumblebee" }
def test_can_post_dict_as_json(self): http = HTTP(b"httq.io:8080") response = http.post(b"/json?foo=bar", {"bee": "bumble"}).response() content = response.content assert content == { "method": "POST", "query": "foo=bar", "content": '{"bee": "bumble"}' }
def test_can_post_dict_as_json(self): http = HTTP(b"httq.io:8080") response = http.post(b"/json?foo=bar", {"bee": "bumble"}).response() content = response.content assert content == {"method": "POST", "query": "foo=bar", "content": '{"bee": "bumble"}'}