Skip to content

Improve MQTT test coverage and remove dead code#33584

Merged
balloob merged 3 commits intohome-assistant:devfrom
emontnemery:mqtt_improve_tests
Apr 3, 2020
Merged

Improve MQTT test coverage and remove dead code#33584
balloob merged 3 commits intohome-assistant:devfrom
emontnemery:mqtt_improve_tests

Conversation

@emontnemery
Copy link
Copy Markdown
Contributor

Proposed change

Improve MQTT test coverage and remove dead code

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

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

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link
Copy Markdown

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (mqtt) you are listed as a codeowner for? Thanks!

@balloob balloob merged commit 4e6fd19 into home-assistant:dev Apr 3, 2020
@emontnemery
Copy link
Copy Markdown
Contributor Author

Test coverage without PR:

----------- coverage: platform linux, python 3.7.5-final-0 -----------
Name                                                     Stmts   Miss  Cover
----------------------------------------------------------------------------
homeassistant/components/mqtt/__init__.py                  615     46    93%
homeassistant/components/mqtt/abbreviations.py               2      0   100%
homeassistant/components/mqtt/alarm_control_panel.py       143      1    99%
homeassistant/components/mqtt/binary_sensor.py             124      0   100%
homeassistant/components/mqtt/camera.py                     69      0   100%
homeassistant/components/mqtt/climate.py                   390      1    99%
homeassistant/components/mqtt/config_flow.py                67     21    69%
homeassistant/components/mqtt/const.py                       9      0   100%
homeassistant/components/mqtt/cover.py                     282      8    97%
homeassistant/components/mqtt/debug_info.py                 68      2    97%
homeassistant/components/mqtt/device_automation.py          29      0   100%
homeassistant/components/mqtt/device_tracker.py             33      0   100%
homeassistant/components/mqtt/device_trigger.py            150      2    99%
homeassistant/components/mqtt/discovery.py                  95      2    98%
homeassistant/components/mqtt/fan.py                       201      4    98%
homeassistant/components/mqtt/light/__init__.py             31      0   100%
homeassistant/components/mqtt/light/schema.py                3      0   100%
homeassistant/components/mqtt/light/schema_basic.py        386      0   100%
homeassistant/components/mqtt/light/schema_json.py         271      0   100%
homeassistant/components/mqtt/light/schema_template.py     222      0   100%
homeassistant/components/mqtt/lock.py                      106      0   100%
homeassistant/components/mqtt/models.py                      9      0   100%
homeassistant/components/mqtt/sensor.py                    104      0   100%
homeassistant/components/mqtt/server.py                     37      0   100%
homeassistant/components/mqtt/subscription.py               48      0   100%
homeassistant/components/mqtt/switch.py                    115      0   100%
homeassistant/components/mqtt/vacuum/__init__.py            29      0   100%
homeassistant/components/mqtt/vacuum/schema.py              16      0   100%
homeassistant/components/mqtt/vacuum/schema_legacy.py      231      2    99%
homeassistant/components/mqtt/vacuum/schema_state.py       153      1    99%
----------------------------------------------------------------------------
TOTAL                                                     4038     90    98%

Test coverage with the PR:

----------- coverage: platform linux, python 3.7.5-final-0 -----------
Name                                                     Stmts   Miss  Cover
----------------------------------------------------------------------------
homeassistant/components/mqtt/__init__.py                  615     31    95%
homeassistant/components/mqtt/abbreviations.py               2      0   100%
homeassistant/components/mqtt/alarm_control_panel.py       143      0   100%
homeassistant/components/mqtt/binary_sensor.py             124      0   100%
homeassistant/components/mqtt/camera.py                     69      0   100%
homeassistant/components/mqtt/climate.py                   390      0   100%
homeassistant/components/mqtt/config_flow.py                67     21    69%
homeassistant/components/mqtt/const.py                       9      0   100%
homeassistant/components/mqtt/cover.py                     274      0   100%
homeassistant/components/mqtt/debug_info.py                 68      0   100%
homeassistant/components/mqtt/device_automation.py          29      0   100%
homeassistant/components/mqtt/device_tracker.py             33      0   100%
homeassistant/components/mqtt/device_trigger.py            150      2    99%
homeassistant/components/mqtt/discovery.py                  90      0   100%
homeassistant/components/mqtt/fan.py                       197      0   100%
homeassistant/components/mqtt/light/__init__.py             31      0   100%
homeassistant/components/mqtt/light/schema.py                3      0   100%
homeassistant/components/mqtt/light/schema_basic.py        386      0   100%
homeassistant/components/mqtt/light/schema_json.py         271      0   100%
homeassistant/components/mqtt/light/schema_template.py     222      0   100%
homeassistant/components/mqtt/lock.py                      106      0   100%
homeassistant/components/mqtt/models.py                      9      0   100%
homeassistant/components/mqtt/sensor.py                    104      0   100%
homeassistant/components/mqtt/server.py                     37      0   100%
homeassistant/components/mqtt/subscription.py               48      0   100%
homeassistant/components/mqtt/switch.py                    115      0   100%
homeassistant/components/mqtt/vacuum/__init__.py            29      0   100%
homeassistant/components/mqtt/vacuum/schema.py              16      0   100%
homeassistant/components/mqtt/vacuum/schema_legacy.py      227      0   100%
homeassistant/components/mqtt/vacuum/schema_state.py       151      0   100%
----------------------------------------------------------------------------
TOTAL                                                     4015     54    99%

@lock lock Bot locked and limited conversation to collaborators Apr 4, 2020
@emontnemery emontnemery deleted the mqtt_improve_tests branch June 10, 2020 18:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants