Skip to content
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

tests(config_flow): add coverage for config exceptions; refactor ConfigFlow tests #102

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

palazzem
Copy link
Owner

@palazzem palazzem commented Nov 3, 2023

Related Issues

n/a

Proposed Changes:

This change improves the testing in the following areas:

  1. Removes validate_credentials as it was a level of indirection. This makes testing straightforward as we don't need to test any helper.
  2. Adds _() test helper that makes mocking easier with long python paths.
  3. Refactors ConfigFlow tests so that they use pytest-mock properly.
  4. Fixes pytest-mock by removing context managers as they are not needed.

Testing:

n/a

Extra Notes (optional):

n/a

Checklist

  • Related issues and proposed changes are filled
  • Tests are defining the correct and expected behavior
  • Code is well-documented via docstrings

@palazzem palazzem added this to the 2.2.0 milestone Nov 3, 2023
@palazzem palazzem self-assigned this Nov 3, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6746822086

  • 6 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.7%) to 89.085%

Totals Coverage Status
Change from base Build 6746814793: 0.7%
Covered Lines: 476
Relevant Lines: 537

💛 - Coveralls

@palazzem palazzem merged commit 77beef0 into main Nov 3, 2023
5 checks passed
@palazzem palazzem deleted the palazzem/test-options-flow branch November 3, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants