mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Cache serialization of config entry storage (#127435)
This commit is contained in:
@@ -18,6 +18,7 @@ from homeassistant.helpers.json import (
|
||||
ExtendedJSONEncoder,
|
||||
JSONEncoder as DefaultHASSJSONEncoder,
|
||||
find_paths_unserializable_data,
|
||||
json_bytes_sorted,
|
||||
json_bytes_strip_null,
|
||||
json_dumps,
|
||||
json_dumps_sorted,
|
||||
@@ -107,6 +108,14 @@ def test_json_dumps_sorted() -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_json_bytes_sorted() -> None:
|
||||
"""Test the json bytes sorted function."""
|
||||
data = {"c": 3, "a": 1, "b": 2}
|
||||
assert json_bytes_sorted(data) == json.dumps(
|
||||
data, sort_keys=True, separators=(",", ":")
|
||||
).encode("utf-8")
|
||||
|
||||
|
||||
def test_json_dumps_float_subclass() -> None:
|
||||
"""Test the json dumps a float subclass."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user