We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test coverage is currently awful - many more need to be made to prevent basic problems like #61
The text was updated successfully, but these errors were encountered:
hi @jamesevickery! I'm hoping to take a look at adding some tests this week/weekend. Have you had any thoughts on this? i.e. any weird edge cases?
A couple of links about mocking the RPi.GPIO module:
Mock objects look really useful for testing functionality around GPIO:
>>> from unittest.mock import MagicMock >>> GPIO = MagicMock() >>> GPIO.setmode(GPIO.BOARD) <MagicMock name='mock.setmode()' id='140549155481584'> >>> GPIO.setmode.assert_called_with(GPIO.BOARD) >>> GPIO.setmode.assert_called_with(GPIO.BCM) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.6/unittest/mock.py", line 814, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: Expected call: setmode(<MagicMock name='mock.BCM' id='140549155494208'>) Actual call: setmode(<MagicMock name='mock.BOARD' id='140549155469016'>)
Sorry, something went wrong.
@alxwrd This looks good 😄
Using MagicMock sounds like a good idea, feel free to add tests
MagicMock
No branches or pull requests
Test coverage is currently awful - many more need to be made to prevent basic problems like #61
The text was updated successfully, but these errors were encountered: