Test pymodbus#49053
Conversation
|
Hey there @adamchengtkc, @vzahradnik, mind taking a look at this pull request as its been labeled with an integration ( |
|
I think this is not a modbus problem, let us try again to see if it is a fluke |
|
Changed mock(_logger) to caplog, as @MartinHjelmare suggested in #48829. I will update the other test (if needed) when providing PR´s for the rest of the outstanding issues. Target is to have most issues solved in 2021.5 |
balloob
left a comment
There was a problem hiding this comment.
This looks great! I had a few tiny comments.
|
@balloob I think all your issues are solved (hopefully to your liking). Lets see if the checks are ok too. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
There's no public interface to the ModbusHub class yet, so then we should avoid accessing it in tests. Or is the plan to make it a public interface, ie public so that other integrations can use the hub instance directly?
|
Just searched in tests/components and it seems all test suites access hass.data, so adding a get_domain function to hass might be a very good idea. |
General test of class modbusHub. test of pymodbus read/write calls. Test modbus service calls.
This is to some extent being tested with the platform tests.
|
This is hopefully a glitch (I am not going to contact security as advised). |
Breaking change
Proposed change
This is a major rewrite of the low level modbus test harness (pymodbus library), tests now include:
This PR allows all modbus platforms to mock class modbusHub (our class) and thus avoid thinking about the pymodbus library. The PR is also helpful in the coming pymodbus upgrade (2.5.1).
Care have been used to ensure the tests do not use the internals of HA.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlJust run pytest.
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:
To help with the load of incoming pull requests: