def test_request_text(self): client = PipelineClientBase('http://example.org') request = client.get("/", content="foo") # In absence of information, everything is JSON (double quote added) assert request.data == json.dumps("foo") request = client.post("/", headers={'content-type': 'text/whatever'}, content="foo") # We want a direct string assert request.data == "foo"
def test_request_text(port, http_request): client = PipelineClientBase("http://localhost:{}".format(port)) if is_rest(http_request): request = http_request("GET", "/", json="foo") else: request = client.get("/", content="foo") # In absence of information, everything is JSON (double quote added) assert request.data == json.dumps("foo") if is_rest(http_request): request = http_request("POST", "/", headers={'content-type': 'text/whatever'}, content="foo") else: request = client.post("/", headers={'content-type': 'text/whatever'}, content="foo") # We want a direct string assert request.data == "foo"