test_devservices_healthcheck.py 382 B

12345678910111213141516
  1. import pytest
  2. from tools.devservices_healthcheck import run_cmd
  3. def test_cmd_run_fail():
  4. with pytest.raises(SystemExit) as exinfo:
  5. run_cmd(["ls", "/tmp/there-is-nothing-here"], retries=1)
  6. assert exinfo.value.code != 0
  7. def test_cmd_run_ok():
  8. try:
  9. run_cmd(["date"])
  10. except Exception as exp:
  11. assert False, f"run_cmd raised expcetion {exp}"