I'm trying to cover some input drivers in the tests/test_drivers.py file, and I ran into a problem - I don't yet understand how to mock multi-level imports (like import luma.emulator.device). So, some input drivers (emulator, pi_gpio and pi_gpio_matrix) are currently not covered by tests because luma.emulator.device and RPi.GPIO can't be mocked. I can't yet figure it out, I've left some attempts in the tests/test_drivers.py file (linked above), but the tests are skipped for now. If someone could help figure this out, it would be great.
I'm trying to cover some input drivers in the
tests/test_drivers.py
file, and I ran into a problem - I don't yet understand how to mock multi-level imports (likeimport luma.emulator.device
). So, some input drivers (emulator, pi_gpio and pi_gpio_matrix) are currently not covered by tests becauseluma.emulator.device
andRPi.GPIO
can't be mocked. I can't yet figure it out, I've left some attempts in thetests/test_drivers.py
file (linked above), but the tests are skipped for now. If someone could help figure this out, it would be great.