-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |