hass-core/tests/helpers/test_supervisor.py
Paulus Schoutsen 938b64081b
Block peer certs on supervisor (#66837)
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-02-22 13:59:40 -08:00

16 lines
534 B
Python

"""Test the Hassio helper."""
from unittest.mock import patch
from homeassistant.helpers.supervisor import has_supervisor
async def test_has_supervisor_yes():
"""Test has_supervisor when supervisor available."""
with patch("homeassistant.helpers.supervisor.os.environ", {"SUPERVISOR": True}):
assert has_supervisor()
async def test_has_supervisor_no():
"""Test has_supervisor when supervisor not available."""
with patch("homeassistant.helpers.supervisor.os.environ"):
assert not has_supervisor()