mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-13 00:07:11 +02:00
simplifies, documents and tests parse_serialized_key helper function
This commit is contained in:
@ -8,9 +8,24 @@ from pydase.utils.helpers import (
|
||||
get_path_from_path_parts,
|
||||
is_property_attribute,
|
||||
parse_full_access_path,
|
||||
parse_serialized_key,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"serialized_key, expected",
|
||||
[
|
||||
("attr_name", "attr_name"),
|
||||
("[0]", 0),
|
||||
("[0.0]", 0.0),
|
||||
('["some_key"]', "some_key"),
|
||||
('["12.34"]', "12.34"),
|
||||
],
|
||||
)
|
||||
def test_parse_serialized_key(serialized_key: str, expected: str) -> None:
|
||||
assert parse_serialized_key(serialized_key) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"full_access_path, expected",
|
||||
[
|
||||
|
Reference in New Issue
Block a user