first working tests

This commit is contained in:
John Lancaster
2024-08-12 19:36:13 -05:00
parent d5714808ed
commit ac3a7d7d37
17 changed files with 281 additions and 97 deletions

17
src/ad_test/utils.py Normal file
View File

@@ -0,0 +1,17 @@
import asyncio
from typing import List
import pytest
from appdaemon.appdaemon import AppDaemon
async def delayed_stop(ad: AppDaemon, delay: float):
await asyncio.sleep(delay)
ad.stop()
def get_load_order(caplog: pytest.LogCaptureFixture) -> List[str]:
for record in caplog.records:
if record.name == "AppDaemon._app_management":
if "Determined module load order" in record.msg:
return record.args[0]