Legacy api fix (#18733)

* Set user for API password requests

* Fix tests

* Fix typing
This commit is contained in:
Paulus Schoutsen 2018-11-27 10:41:44 +01:00 committed by GitHub
parent 9d7b1fc3a7
commit c2f8dfcb9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 148 additions and 74 deletions

View file

@ -56,7 +56,7 @@ SENSOR_OUTPUT = {
@pytest.fixture
def mock_client(hass, aiohttp_client):
def mock_client(hass, hass_client):
"""Start the Home Assistant HTTP component."""
with patch('homeassistant.components.spaceapi',
return_value=mock_coro(True)):
@ -70,7 +70,7 @@ def mock_client(hass, aiohttp_client):
hass.states.async_set('test.hum1', 88,
attributes={'unit_of_measurement': '%'})
return hass.loop.run_until_complete(aiohttp_client(hass.http.app))
return hass.loop.run_until_complete(hass_client())
async def test_spaceapi_get(hass, mock_client):