Add tests for Netatmo oauth2 api (#46375)

* Add Netatmo tests for api

* Update tests/components/netatmo/test_api.py

* Update .coveragerc

Co-authored-by: Erik Montnemery <erik@montnemery.com>
pull/48088/head
Tobias Sauerwein 2021-03-18 14:55:39 +01:00 committed by GitHub
parent b67b9b94f9
commit 7d196abc4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -644,7 +644,6 @@ omit =
homeassistant/components/nello/lock.py
homeassistant/components/nest/legacy/*
homeassistant/components/netatmo/__init__.py
homeassistant/components/netatmo/api.py
homeassistant/components/netatmo/camera.py
homeassistant/components/netatmo/data_handler.py
homeassistant/components/netatmo/helper.py

View File

@ -0,0 +1,14 @@
"""The tests for the Netatmo oauth2 api."""
from unittest.mock import patch
from homeassistant.components.netatmo import api
async def test_api(hass, config_entry):
"""Test auth instantiation."""
with patch(
"homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation",
) as fake_implementation:
auth = api.ConfigEntryNetatmoAuth(hass, config_entry, fake_implementation)
assert isinstance(auth, api.ConfigEntryNetatmoAuth)