Make startup more stable (#2167)

This commit is contained in:
Pascal Vizeli
2020-10-23 16:48:03 +02:00
committed by GitHub
parent c423e9cf8e
commit 042bdcdf37
3 changed files with 47 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
"""Common test functions."""
from pathlib import Path
from unittest.mock import MagicMock, PropertyMock, patch
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from uuid import uuid4
from aiohttp import web
@@ -148,6 +148,7 @@ async def api_client(aiohttp_client, coresys: CoreSys):
"""Fixture for RestAPI client."""
api = RestAPI(coresys)
api.webapp = web.Application()
api.start = AsyncMock()
await api.load()
yield await aiohttp_client(api.webapp)