Files
dotfiles/tests/test_common.py
T
Richie 6a0e3ebcdb refactor: extract signal_alert into its own module
Move signal_alert out of python/common.py into a dedicated
python/signal_alert.py module and update its importers
(validate_system.py, snapshot_manager.py) to the new path.

Relocate the signal_alert tests from tests/test_common.py into
tests/test_signal_alert.py, repatching python.signal_alert.logger and
python.signal_alert.Apprise to match the new module.
2026-07-09 11:04:59 -04:00

26 lines
667 B
Python

"""test_common."""
from __future__ import annotations
from python.common import bash_wrapper, utcnow
def test_utcnow() -> None:
"""test_utcnow."""
utcnow()
def test_test_bash_wrapper() -> None:
"""test_test_bash_wrapper."""
stdout, returncode = bash_wrapper("echo test")
assert stdout == "test\n"
assert returncode == 0
def test_test_bash_wrapper_error() -> None:
"""test_test_bash_wrapper_error."""
expected_error = 2
stdout, returncode = bash_wrapper("ls /this/path/does/not/exist")
assert stdout == "ls: cannot access '/this/path/does/not/exist': No such file or directory\n"
assert returncode == expected_error