aboutsummaryrefslogtreecommitdiff
path: root/tests/serialize/errors.test.py
diff options
context:
space:
mode:
authornatsuoto <[email protected]>2026-07-16 17:31:49 +0530
committernatsuoto <[email protected]>2026-07-16 17:31:49 +0530
commit1b43c8dc09adb9b54609cc8a1916c99eb6fe75c9 (patch)
tree7731af50ed9117f8ac3d200591c3be23818d7b19 /tests/serialize/errors.test.py
parentb7ae2f3885d5ff84237c9da8bc0c64fe1a509465 (diff)
downloadedify-1b43c8dc09adb9b54609cc8a1916c99eb6fe75c9.tar.xz
edify-1b43c8dc09adb9b54609cc8a1916c99eb6fe75c9.zip
chore: enforce fully strict static typing across library, tests, and tooling with zero suppressions
Diffstat (limited to 'tests/serialize/errors.test.py')
-rw-r--r--tests/serialize/errors.test.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/serialize/errors.test.py b/tests/serialize/errors.test.py
index 1b7dd39..cc5ec30 100644
--- a/tests/serialize/errors.test.py
+++ b/tests/serialize/errors.test.py
@@ -11,6 +11,7 @@ from edify.errors.serialize import (
NonObjectJSONPayloadError,
UnknownElementKindError,
)
+from edify.serialize import JSONValue
def test_missing_edify_key_raises():
@@ -24,7 +25,7 @@ def test_missing_pattern_key_raises():
def test_missing_kind_on_nested_node_raises():
- document = {
+ document: dict[str, JSONValue] = {
"edify": 0,
"pattern": {"kind": "root", "children": [{"value": "x"}]},
}
@@ -33,13 +34,13 @@ def test_missing_kind_on_nested_node_raises():
def test_incompatible_schema_version_raises():
- document = {"edify": 999, "pattern": {"kind": "root", "children": []}}
+ document: dict[str, JSONValue] = {"edify": 999, "pattern": {"kind": "root", "children": []}}
with pytest.raises(IncompatibleSchemaVersionError):
Pattern.from_dict(document)
def test_unknown_kind_raises():
- document = {
+ document: dict[str, JSONValue] = {
"edify": 0,
"pattern": {"kind": "root", "children": [{"kind": "mystery"}]},
}
@@ -58,12 +59,15 @@ def test_non_object_json_payload_raises_non_object_json_payload_error():
def test_incompatible_schema_version_with_composite_value_stringifies_it():
- document = {"edify": [1, 2, 3], "pattern": {"kind": "root", "children": []}}
+ document: dict[str, JSONValue] = {
+ "edify": [1, 2, 3],
+ "pattern": {"kind": "root", "children": []},
+ }
with pytest.raises(IncompatibleSchemaVersionError):
Pattern.from_dict(document)
def test_pattern_key_not_a_root_element_produces_empty_pattern():
- document = {"edify": 0, "pattern": {"kind": "digit"}}
+ document: dict[str, JSONValue] = {"edify": 0, "pattern": {"kind": "digit"}}
restored = Pattern.from_dict(document)
assert restored.to_regex_string() == "(?:)"