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

Improve rflink coverage #19596

Merged
merged 19 commits into from Jan 1, 2019

Conversation

Projects
None yet
4 participants
@javicalle
Copy link
Contributor

javicalle commented Dec 26, 2018

Description:

This PR aims to improve the code coverage for all RFLink tests

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example). N/A
  • New dependencies are only imported inside functions that use them (example). N/A
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py. N/A
  • New files were added to .coveragerc. N/A

If the code does not interact with devices:

  • Tests have been added to verify that the new code works. N/A
@marchingphoenix
Copy link
Contributor

marchingphoenix left a comment

Thanks for the test updates!

Show resolved Hide resolved tests/components/light/test_rflink.py Outdated

@MartinHjelmare MartinHjelmare changed the title [WIP] Improvements rflink coverage [WIP] Improve rflink coverage Dec 28, 2018

@javicalle
Copy link
Contributor

javicalle left a comment

"Sensor events" are removed at Sensor class
I believe that RflinkDevice only handle "Command events"
Bogus entities are created dynamically and stored in separeted data according to the event type.

Show resolved Hide resolved homeassistant/components/rflink.py
@javicalle

This comment has been minimized.

Copy link
Contributor

javicalle commented Dec 28, 2018

All tests passed and coverage up to 100%
The last 2 lines a bit forced to cover them, but a good exercise to view and understand the coverage code.

Test race condition for unknown components
Test cleanup for `commands events` and `sensor events`

@javicalle javicalle changed the title [WIP] Improve rflink coverage Improve rflink coverage Dec 31, 2018

@emontnemery
Copy link
Contributor

emontnemery left a comment

lgtm

@emontnemery emontnemery merged commit b9f4a72 into home-assistant:dev Jan 1, 2019

5 checks passed

Hound No violations found. Woof!
WIP Legacy commit status override — see details
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.04%) to 93.083%
Details

@wafflebot wafflebot bot removed the in progress label Jan 1, 2019

@javicalle

This comment has been minimized.

Copy link
Contributor

javicalle commented Jan 1, 2019

Thank you very much guys.

sqldiablo added a commit to sqldiablo/home-assistant that referenced this pull request Jan 2, 2019

Improve rflink coverage (home-assistant#19596)
* some minor tests refactor
* async/await refactor
* toggle have not brightness
* test for race condition in unknown device
* test for 'no_command' and 'not_connected'
* test for race condition in unknown device
* sensor events are handled in sensor devices, RflinkDevice handle
command events
* test race conditions & bogus entity remove
* two more tests
* Test race condition for unknown components
* Test cleanup for `commands events` and `sensor events`

sqldiablo added a commit to sqldiablo/home-assistant that referenced this pull request Jan 3, 2019

Improve rflink coverage (home-assistant#19596)
* some minor tests refactor
* async/await refactor
* toggle have not brightness
* test for race condition in unknown device
* test for 'no_command' and 'not_connected'
* test for race condition in unknown device
* sensor events are handled in sensor devices, RflinkDevice handle
command events
* test race conditions & bogus entity remove
* two more tests
* Test race condition for unknown components
* Test cleanup for `commands events` and `sensor events`

mxworm added a commit to mxworm/home-assistant that referenced this pull request Jan 3, 2019

Merge branch 'dev' into current
* dev:
  Adds ability to calibrate temperature for BME680 (home-assistant#19684)
  Bumping aioasuswrt version to 1.1.17 (home-assistant#19714)
  Bump pyotgw to 0.4b1 (home-assistant#19715)
  Envisalink pgm (home-assistant#19499)
  Update pyhomematic 0.1.54 + small fixes (home-assistant#19667)
  Add ness alarm control panel using nessclient (home-assistant#18463)
  Add support for color_temp_command_template in MQTT light component (home-assistant#19675)
  Improve rflink coverage (home-assistant#19596)
  Luftdaten traceback (home-assistant#19666)
  Fix london_underground issue (home-assistant#19642)
  Add IDTECK proximity card component (home-assistant#18309)
  Fix homekit_controller pairing regression (home-assistant#19654)
  Fix error in got_connected for remote.harmony (home-assistant#19662)
  Fix exception checking for next dublin bus (home-assistant#19663)
  Added regexp validation allowing Twilio notifications to use Sender ID instead of phone number (home-assistant#19644)
  pytraccar version bump (home-assistant#19659)
  Suppress traceback if network is not available

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

kellerza added a commit to kellerza/home-assistant that referenced this pull request Jan 18, 2019

Improve rflink coverage (home-assistant#19596)
* some minor tests refactor
* async/await refactor
* toggle have not brightness
* test for race condition in unknown device
* test for 'no_command' and 'not_connected'
* test for race condition in unknown device
* sensor events are handled in sensor devices, RflinkDevice handle
command events
* test race conditions & bogus entity remove
* two more tests
* Test race condition for unknown components
* Test cleanup for `commands events` and `sensor events`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment