Skip to content

Commit

Permalink
chore: add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Jan 24, 2025
1 parent b70cb16 commit 371fe78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/aioharmony/json.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from functools import partial
from typing import Any

import orjson

try:
import orjson

Expand All @@ -13,5 +12,5 @@ def json_dumps(obj: Any) -> str:
except ImportError:
import json

json_dumps = json.dumps
json_dumps = partial(json.dumps, separators=(",", ":"))
json_loads = json.loads
9 changes: 9 additions & 0 deletions tests/test_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from aioharmony.json import json_dumps, json_loads


def test_json_dumps():
assert json_dumps({"foo": "bar"}) == '{"foo":"bar"}'


def test_json_loads():
assert json_loads('{"foo":"bar"}') == {"foo": "bar"}

0 comments on commit 371fe78

Please sign in to comment.