palazzem / ha-econnect-alarm

Home Assistant integration that provides a full-fledged Alarm Panel to control your Elmo/IESS alarm systems.
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

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

Closed palazzem closed 7 months ago

palazzem commented 7 months ago

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

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 6746822086


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

💛 - Coveralls