Implement mocking and unit tests for PoKeysLib integration without hardware.
Mocks and Simulators:
Add tests/mocks/pokeyslib_mock.py to implement mock objects for PoKeysLib device interactions.
Include functions for digital I/O, analog I/O, counters, and PWM.
Simulate expected values and edge cases.
Dependency Injection:
Modify pokeys_py/__init__.py to import pokeyslib_mock when running in CI environment.
Update pokeys_py/analog_io.py, pokeys_py/counter.py, pokeys_py/digital_io.py, pokeys_py/pev2_motion_control.py, and pokeys_py/pwm.py to add dependency injection for pokeyslib.
CI Configuration:
Update .github/workflows/ci.yml to include environment checks for switching between real hardware and mocks.
Add steps to run tests with mocks in CI environment.
Documentation:
Update README.md with instructions for running tests with mocks or simulators.
Include details on setting environment variables to toggle between real and mock devices.
Related to #57
Implement mocking and unit tests for PoKeysLib integration without hardware.
tests/mocks/pokeyslib_mock.py
to implement mock objects for PoKeysLib device interactions.pokeys_py/__init__.py
to importpokeyslib_mock
when running in CI environment.pokeys_py/analog_io.py
,pokeys_py/counter.py
,pokeys_py/digital_io.py
,pokeys_py/pev2_motion_control.py
, andpokeys_py/pwm.py
to add dependency injection forpokeyslib
..github/workflows/ci.yml
to include environment checks for switching between real hardware and mocks.README.md
with instructions for running tests with mocks or simulators.For more details, open the Copilot Workspace session.