better reset encapsulation

This commit is contained in:
John Lancaster
2024-08-12 20:46:13 -05:00
parent 3f75a4cf43
commit 0c01f2c4d7

View File

@@ -30,21 +30,18 @@ def modify_file(path: Path):
path.write_text(modified_content)
def test_file(ad: AppDaemon, caplog: pytest.LogCaptureFixture):
def test_file(ad: AppDaemon, caplog: pytest.LogCaptureFixture, config_repo: Repo):
assert isinstance(ad, AppDaemon)
# ad.loop.run_until_complete(asyncio.sleep(2.0))
module_file = Path(food.meal.__file__)
reset_file(module_file)
modify_file(module_file)
logging.getLogger('AppDaemon').propagate = True
with caplog.at_level(logging.DEBUG, logger='AppDaemon._app_management'):
# running_ad.loop.run_until_complete(delayed_stop(running_ad, 2.0))
print('waiting in test')
ad.loop.run_until_complete(asyncio.sleep(2.0))
ad.loop.run_until_complete(asyncio.sleep(1.0))
module_load_order = get_load_order(caplog)
assert module_load_order == ['food.meal', 'restaurant']
print('done')
module_load_order = get_load_order(caplog)
assert module_load_order == ['food.meal', 'restaurant']
reset_file(module_file)
ad.loop.run_until_complete(asyncio.sleep(1.0))