Add tests for Netatmo camera (#46380)

* Add test for Netatmo camera

* Improve docstrings

* Remove light tests

* Remove freezegun from tests

* Update camera tests

* Remove freezegun dependency

* Update tests/components/netatmo/test_camera.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update tests/components/netatmo/test_camera.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Deduplication of the fake webhook payload

* Mock pyatmo instead of checking the logs

* Clean up

* Further deduplication

* Assert function arguments

* Rename mocked functions

* Update .coveragerc

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Tobias Sauerwein 2021-03-19 12:19:57 +01:00 committed by GitHub
parent aaafe399a1
commit 4ee4d674d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 210 additions and 2 deletions

View file

@ -350,7 +350,7 @@ class NetatmoCamera(NetatmoBase, Camera):
def _service_set_camera_light(self, **kwargs):
"""Service to set light mode."""
mode = kwargs.get(ATTR_CAMERA_LIGHT_MODE)
_LOGGER.debug("Turn camera '%s' %s", self._name, mode)
_LOGGER.debug("Turn %s camera light for '%s'", mode, self._name)
self._data.set_state(
home_id=self._home_id,
camera_id=self._id,