Beispiel #1
0
 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"}
Beispiel #2
0
 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"
     }
Beispiel #3
0
 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"}'
     }
Beispiel #4
0
 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"}'}