Migrate camera tests from coroutine to async/await (#30372)

This commit is contained in:
Franck Nijhof 2020-01-02 00:21:21 +01:00 committed by Andrew Sayre
parent 8814e1eadc
commit c837f185f7

View File

@ -147,8 +147,7 @@ class TestGetImage:
).result()
@asyncio.coroutine
def test_snapshot_service(hass, mock_camera):
async def test_snapshot_service(hass, mock_camera):
"""Test snapshot service."""
mopen = mock_open()
@ -156,7 +155,7 @@ def test_snapshot_service(hass, mock_camera):
"homeassistant.components.camera.open", mopen, create=True
), patch.object(hass.config, "is_allowed_path", return_value=True):
common.async_snapshot(hass, "/tmp/bla")
yield from hass.async_block_till_done()
await hass.async_block_till_done()
mock_write = mopen().write