コード例 #1
0
ファイル: test.py プロジェクト: pombredanne/httq
 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"}
コード例 #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"
     }
コード例 #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"}'
     }
コード例 #4
0
ファイル: test.py プロジェクト: pombredanne/httq
 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"}'}