mirror of
https://github.com/tiqi-group/pydase.git
synced 2026-01-19 10:22:24 +01:00
tests: adds test for exception serialization
This commit is contained in:
@@ -1225,3 +1225,22 @@ def test_add_prefix_to_full_access_path(
|
|||||||
serialized_obj: SerializedObject, prefix: str, expected: SerializedObject
|
serialized_obj: SerializedObject, prefix: str, expected: SerializedObject
|
||||||
) -> None:
|
) -> None:
|
||||||
assert add_prefix_to_full_access_path(serialized_obj, prefix) == expected
|
assert add_prefix_to_full_access_path(serialized_obj, prefix) == expected
|
||||||
|
|
||||||
|
|
||||||
|
def test_serialize_exception() -> None:
|
||||||
|
assert dump(Exception()) == {
|
||||||
|
"doc": None,
|
||||||
|
"full_access_path": "",
|
||||||
|
"name": "Exception",
|
||||||
|
"readonly": True,
|
||||||
|
"type": "Exception",
|
||||||
|
"value": "",
|
||||||
|
}
|
||||||
|
assert dump(Exception("Exception message")) == {
|
||||||
|
"doc": None,
|
||||||
|
"full_access_path": "",
|
||||||
|
"name": "Exception",
|
||||||
|
"readonly": True,
|
||||||
|
"type": "Exception",
|
||||||
|
"value": "Exception message",
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user