]> git.ipfire.org Git - thirdparty/httpx.git/commit
Fix JSON wrong encoding tests on big endian platforms (#1781)
authorMichał Górny <mgorny@gentoo.org>
Thu, 5 Aug 2021 16:05:38 +0000 (18:05 +0200)
committerGitHub <noreply@github.com>
Thu, 5 Aug 2021 16:05:38 +0000 (17:05 +0100)
commitee24e6718035e048ec86f3490a964b08fd49031c
tree5300fd701f21de726f75b1c847d758142e0c8705
parent8c64e0c65fa6a657ee5d5055ca89c43d8afdf99a
Fix JSON wrong encoding tests on big endian platforms (#1781)

Fix test_json_without_specified_encoding_*_error tests on big endian
platforms.  The tests wrongly assume that data encoded as "utf-32-be"
can not be decoded as "utf-32".  This is true on little endian platforms
but on big endian platforms "utf-32" is equivalent to "utf-32-be".
To avoid the problem, explicitly decode as "utf-32-le", as this should
trigger the expected exception independently of platform's endianness.
tests/models/test_responses.py