Skip to content

Reolink test init 100%#89112

Merged
epenet merged 19 commits into
home-assistant:devfrom
starkillerOG:reolink_tests
Mar 7, 2023
Merged

Reolink test init 100%#89112
epenet merged 19 commits into
home-assistant:devfrom
starkillerOG:reolink_tests

Conversation

@starkillerOG
Copy link
Copy Markdown
Contributor

Breaking change

Proposed change

Clean up reolink tests and fixtures.
Bring test coverage for the init.py file to 100% for the Reolink integration.

Requested by @epenet in this PR: #88903 (comment)

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

Comment thread tests/components/reolink/conftest.py Outdated
Comment thread tests/components/reolink/conftest.py Outdated
Comment thread tests/components/reolink/test_init.py
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Mar 4, 2023

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft March 4, 2023 22:06
@starkillerOG starkillerOG marked this pull request as ready for review March 6, 2023 19:20
@home-assistant home-assistant Bot requested a review from frenck March 6, 2023 19:20
Comment thread tests/components/reolink/conftest.py Outdated
Comment thread tests/components/reolink/test_config_flow.py Outdated
Comment thread tests/components/reolink/test_config_flow.py Outdated
Comment thread tests/components/reolink/test_config_flow.py Outdated
Comment thread tests/components/reolink/test_config_flow.py Outdated
Comment thread tests/components/reolink/test_config_flow.py Outdated
Comment thread tests/components/reolink/test_init.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft March 6, 2023 21:21
starkillerOG and others added 4 commits March 6, 2023 22:31
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
@starkillerOG starkillerOG marked this pull request as ready for review March 6, 2023 21:55
@home-assistant home-assistant Bot requested a review from frenck March 6, 2023 21:56
Comment thread tests/components/reolink/conftest.py Outdated
Comment thread tests/components/reolink/conftest.py Outdated
Comment thread tests/components/reolink/conftest.py Outdated
Comment thread tests/components/reolink/test_init.py Outdated
Comment thread tests/components/reolink/test_init.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft March 7, 2023 08:15
starkillerOG and others added 6 commits March 7, 2023 10:26
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
@starkillerOG starkillerOG marked this pull request as ready for review March 7, 2023 09:42
@home-assistant home-assistant Bot requested a review from epenet March 7, 2023 09:42
Comment thread tests/components/reolink/test_init.py
@home-assistant home-assistant Bot marked this pull request as draft March 7, 2023 10:13
@starkillerOG starkillerOG marked this pull request as ready for review March 7, 2023 10:19
@home-assistant home-assistant Bot requested a review from frenck March 7, 2023 10:19
@frenck frenck marked this pull request as draft March 7, 2023 10:23
@starkillerOG starkillerOG marked this pull request as ready for review March 7, 2023 11:04
Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks @starkillerOG 👍

@epenet are you ok with the changes?

@epenet epenet merged commit 2d3c5cf into home-assistant:dev Mar 7, 2023
jpbaltazar pushed a commit to jpbaltazar/inels-home-assistant that referenced this pull request Mar 8, 2023
* Split out reolink tests

* Bring __init__ coverage to 100%

* Improve docstrings

* Use patching and autospec=True for ReolinkHost

* Use fixture

* fix styling

* Parametrize tests

* Update tests/components/reolink/conftest.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update test_config_flow.py

* convert to fixture

* review comments

* Update tests/components/reolink/conftest.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update tests/components/reolink/conftest.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update tests/components/reolink/conftest.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* fix tests

* fix imports

* Update test_init.py

* Check if host is logout on reload

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 8, 2023
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.

4 participants