core/tests/util/test_system_info.py
Craig Andrews 9e8df72c0d
Improve is docker env checks (#132404)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Sander Hoentjen <sander@hoentjen.eu>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Robert Resch <robert@resch.dev>
2025-01-02 17:21:49 +01:00

16 lines
543 B
Python

"""Tests for the system info helper."""
from unittest.mock import patch
from homeassistant.util.system_info import is_official_image
async def test_is_official_image() -> None:
"""Test is_official_image."""
is_official_image.cache_clear()
with patch("homeassistant.util.system_info.os.path.isfile", return_value=True):
assert is_official_image() is True
is_official_image.cache_clear()
with patch("homeassistant.util.system_info.os.path.isfile", return_value=False):
assert is_official_image() is False