Revert "Fix connection issues with withings API by switching to a maintained codebase (#27310)" (#27385)

This reverts commit 071476343c.
This commit is contained in:
Martin Hjelmare 2019-10-10 14:21:42 +02:00 committed by Bram Kragten
parent d337b71725
commit c188ecf79b
9 changed files with 117 additions and 130 deletions

View file

@ -1,6 +1,6 @@
"""Tests for the Withings component."""
from asynctest import MagicMock
import withings_api as withings
import nokia
from oauthlib.oauth2.rfc6749.errors import MissingTokenError
import pytest
from requests_oauthlib import TokenUpdated
@ -13,19 +13,19 @@ from homeassistant.components.withings.common import (
from homeassistant.exceptions import PlatformNotReady
@pytest.fixture(name="withings_api")
def withings_api_fixture():
"""Provide withings api."""
withings_api = withings.WithingsApi.__new__(withings.WithingsApi)
withings_api.get_measures = MagicMock()
withings_api.get_sleep = MagicMock()
return withings_api
@pytest.fixture(name="nokia_api")
def nokia_api_fixture():
"""Provide nokia api."""
nokia_api = nokia.NokiaApi.__new__(nokia.NokiaApi)
nokia_api.get_measures = MagicMock()
nokia_api.get_sleep = MagicMock()
return nokia_api
@pytest.fixture(name="data_manager")
def data_manager_fixture(hass, withings_api: withings.WithingsApi):
def data_manager_fixture(hass, nokia_api: nokia.NokiaApi):
"""Provide data manager."""
return WithingsDataManager(hass, "My Profile", withings_api)
return WithingsDataManager(hass, "My Profile", nokia_api)
def test_print_service():