Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch> Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
16 lines
534 B
Python
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()
|