-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
New issue
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
Add tests for Z-Wave #6437
Comments
I think as the first core what we'll need is a mock ZWaveNetwork that returns mock node and value objects. I think it has to be mocked at a layer a little bit higher than mqtt, since we don't even build openzwave on CI. |
I'll try to write some basic mocks today. Looking forward we might want to put it in an external library, but let's start small :) |
We should be able to create a separate file in the tests folder that can hold all the mock classes, and then import that where we need it. We can throw some module patching logic like you have here at the beginning of this new file. I'll hold off on this for now if you're going to work on it. We can probably divvy it up once we get a solid template. |
Eventually won't have time for this today. Hopefully tomorrow. |
I'm giving it a spin to see what I can come up with. |
No, I did not cook this up in the 6 minutes since my last comment ;-) I only realized that I forgot to post that I was looking into it. Anyway, I have a first pass up for the Z-Wave light platform: #6483 Includes a |
If we want to consider Z-Wave a serious member of the Home Assistant family, we will need to make sure there is proper test coverage of the component and platforms.
@andrey-git made a very small start but we need more tests, a lot more. We should create a mock OpenZWave like we did for MQTT, so that it will be easy to do something like
mock_zwave.trigger_value_changed(…)
(Update Mar '17: the mock Open Z-Wave stack has been added)Here is a quick (and not complete) roundup of things that will require tests:
ZWaveOption
in setupTo ensure we are not making it worse, all Z-Wave PRs moving forward will require tests to be written.
As of April 6, 2017: 71.46% coverage for main file: report. All other files have 100% 🎉
The text was updated successfully, but these errors were encountered: