better reset encapsulation
This commit is contained in:
@@ -30,21 +30,18 @@ def modify_file(path: Path):
|
|||||||
path.write_text(modified_content)
|
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)
|
assert isinstance(ad, AppDaemon)
|
||||||
|
|
||||||
# ad.loop.run_until_complete(asyncio.sleep(2.0))
|
|
||||||
|
|
||||||
module_file = Path(food.meal.__file__)
|
module_file = Path(food.meal.__file__)
|
||||||
reset_file(module_file)
|
|
||||||
modify_file(module_file)
|
modify_file(module_file)
|
||||||
|
|
||||||
logging.getLogger('AppDaemon').propagate = True
|
logging.getLogger('AppDaemon').propagate = True
|
||||||
with caplog.at_level(logging.DEBUG, logger='AppDaemon._app_management'):
|
with caplog.at_level(logging.DEBUG, logger='AppDaemon._app_management'):
|
||||||
# running_ad.loop.run_until_complete(delayed_stop(running_ad, 2.0))
|
ad.loop.run_until_complete(asyncio.sleep(1.0))
|
||||||
print('waiting in test')
|
|
||||||
ad.loop.run_until_complete(asyncio.sleep(2.0))
|
|
||||||
|
|
||||||
module_load_order = get_load_order(caplog)
|
module_load_order = get_load_order(caplog)
|
||||||
assert module_load_order == ['food.meal', 'restaurant']
|
assert module_load_order == ['food.meal', 'restaurant']
|
||||||
print('done')
|
|
||||||
|
reset_file(module_file)
|
||||||
|
ad.loop.run_until_complete(asyncio.sleep(1.0))
|
||||||
|
|||||||
Reference in New Issue
Block a user