plesty.lib.test.device_func_system ================================== .. py:module:: plesty.lib.test.device_func_system .. autoapi-nested-parse:: Automated function system testing utilities for Plesty devices. Functions --------- .. autoapisummary:: plesty.lib.test.device_func_system._build_mock_solver plesty.lib.test.device_func_system.auto_test Module Contents --------------- .. py:function:: _build_mock_solver(device, generator: plesty.lib.sim.data_generator.DataGenerator) Build a mock op solver that returns generated response dictionaries. .. py:function:: auto_test(device_cls: Any, *args: Any, use_mock_solver: bool = True, ignore_ops: Any = None, seed: int | None = 123, sleep_time: float = 0.1, device_kwargs: dict[str, Any] | None = None, **kwargs: Any) -> None Auto test function system for a device class. This test uses FuncParam metadata to generate valid inputs and can bind a mock solver to generate FuncOutput-shaped responses. :param device_cls: The device class under test. :param \*args: Positional arguments forwarded to ``device_cls``. :param use_mock_solver: Bind the generated mock solver instead of calling whatever solver the module bound itself. :param ignore_ops: Operation names to skip. :param seed: RNG seed for reproducible generated payloads. :param sleep_time: Delay between operations, to avoid overwhelming an instrument. Ignored under *use_mock_solver* — there is no instrument to pace. :param device_kwargs: Keyword arguments forwarded to ``device_cls``, kept apart from this function's own. A device constructor taking a ``use_mock_solver`` or ``seed`` argument — one reference module takes the first — collides with the parameters above when the two are merged, and the call fails with "got multiple values". :param \*\*kwargs: Keyword arguments forwarded to ``device_cls``. Prefer *device_kwargs* for anything that might share a name. :raises AssertionError: If any operation failed or returned a non-dict, or if mock mode was asked for and the device cannot accept a solver.