plesty.lib.test.schema_params ============================= .. py:module:: plesty.lib.test.schema_params .. autoapi-nested-parse:: Helper functions for testing device schema parameter refresh workflows. Functions --------- .. autoapisummary:: plesty.lib.test.schema_params._load_schema plesty.lib.test.schema_params._infer_schema_type plesty.lib.test.schema_params._serialize_value plesty.lib.test.schema_params._write_schema plesty.lib.test.schema_params._iter_grouped_params plesty.lib.test.schema_params._resolve_schema_entry plesty.lib.test.schema_params._remove_schema_entry plesty.lib.test.schema_params.test_real_device_refreshes_schema_defaults_and_types Module Contents --------------- .. py:function:: _load_schema(p) -> dict .. py:function:: _infer_schema_type(value) -> str .. py:function:: _serialize_value(value, inferred_type: str) .. py:function:: _write_schema(schema: dict, destination: pathlib.Path) -> None .. py:function:: _iter_grouped_params(schema: dict) Yield (group_name, command_prefix, parameters) for each group in the schema. .. py:function:: _resolve_schema_entry(schema: dict, key: str) -> dict Resolve a schema entry for flat and grouped schema styles. Supported shapes: 1. Flat/default map, including dotted keys like ``GroupName.ParamName``. 2. Grouped map where runtime keys use ``group_prefix.param_key``. .. py:function:: _remove_schema_entry(schema: dict, key: str) -> None Remove a schema entry for flat and grouped schema styles. .. py:function:: test_real_device_refreshes_schema_defaults_and_types(device_cls: Any, param_schema: Any = None, *args: Any, **kwargs: Any) -> None Test that a real device can refresh its schema and that defaults/types are consistent.