MCPcopy
hub / github.com/encode/httpx / test_json_with_options

Function test_json_with_options

tests/models/test_responses.py:801–810  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

799
800
801def test_json_with_options():
802 data = {"greeting": "hello", "recipient": "world", "amount": 1}
803 content = json.dumps(data).encode("utf-16")
804 headers = {"Content-Type": "application/json, charset=utf-16"}
805 response = httpx.Response(
806 200,
807 content=content,
808 headers=headers,
809 )
810 assert response.json(parse_int=str)["amount"] == "1"
811
812
813@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

jsonMethod · 0.95

Tested by

no test coverage detected