Add tests for Plugwise integration#36371
Conversation
|
Set to draft so #36378 can take presedence and we can beef up this one with |
b360a5f to
c0dd48e
Compare
|
Not sure why codecov is complaining (in more detail, it's complaining on coverage differences outside my changes). Local coverage report shows: |
|
Low score on |
c0dd48e to
26c7f7a
Compare
ef06f82 to
22551d6
Compare
|
If someone is open for discussion on xml versus pickle, please ping me on discord (or mention me in the appropriate dev-channel). |
7b4db87 to
b67c8f2
Compare
…and thus testing pickles
9f9dea9 to
948f27a
Compare
|
@MartinHjelmare just re-checked myself (using the famous websearch) and looks like https://pypi.org/project/jsonpickle/ does provide a solution for storing sets and 'it works on my laptop'. I'm not sure how to get (if allowed anyway) the jsonpickle module in onto testing (reading https://developers.home-assistant.io/docs/development_testing points towards a list in the script, but I'm not clear which list/dict is for testing only). |
|
(jsonpickle as a module worked out of the box?) |
|
Add it to the integration manifest requirements. |
Too bad we cant select for testing purposes only, not in the least since we have to pin requirements :( |
|
We don't have any infrastructure for integration specific test dependencies. Then we would need to add it to our common test requirements. I can check if we want that. |
|
We have a go ahead to add |
|
Having these in place will ensure the code is better and other people will be able to modify/extend with more ease and security :) |
Proposed change
Add testing fixtures and tests (besides the mandatory
config_flowfor the Plugwise integration. Earlier I prepared a version with aiohttp mocking, but that would generate a hefty amount of XML data in fixtures (even gzipped), rewrote using pickles written out by our API module from that same data.I'm trying to keep the amount of fixtures as low as possible - I could tidy up a bit more by using a smaller
environment, though the selected three environments to run the tests against are about the most diverse we have test data available for from our API module development.Comments or recommendations welcome (here or on discord)
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following [Integration Quality Scale][quality-scale]: