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

Function test_json_with_specified_charset

tests/models/test_responses.py:851–860  ·  view source on GitHub ↗
(encoding)

Source from the content-addressed store, hash-verified

849 ],
850)
851def test_json_with_specified_charset(encoding):
852 data = {"greeting": "hello", "recipient": "world"}
853 content = json.dumps(data).encode(encoding)
854 headers = {"Content-Type": f"application/json; charset={encoding}"}
855 response = httpx.Response(
856 200,
857 content=content,
858 headers=headers,
859 )
860 assert response.json() == data
861
862
863@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

jsonMethod · 0.95

Tested by

no test coverage detected