1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 12:29:08 +00:00

Supervisor container startup health function (#2214)

* Supervisor container startup health function

* better struct

* add test

* address comment

* rename file

* Update tests/test_main.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
Pascal Vizeli
2020-11-03 16:36:10 +01:00
committed by GitHub
parent 608ae14246
commit 28344ff5f3
2 changed files with 34 additions and 0 deletions

17
tests/test_main.py Normal file
View File

@@ -0,0 +1,17 @@
"""Testing handling with main."""
from pathlib import Path
import supervisor.__main__ as main
def test_write_state(tmp_path):
"""Test startup-marker file cleanup."""
test_file = Path(tmp_path, "test.file")
test_file.touch()
assert test_file.exists()
main.CONTAINER_OS_STARTUP_CHECK = test_file
main.run_os_startup_check_cleanup()
assert not test_file.exists()