mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-10 10:46:29 +00:00
parent
e406aa4144
commit
53fa8e48c0
@ -40,6 +40,7 @@ def sys_machine():
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def sys_supervisor():
|
def sys_supervisor():
|
||||||
|
"""Mock sys_supervisor."""
|
||||||
with patch(
|
with patch(
|
||||||
"supervisor.coresys.CoreSys.supervisor", new_callable=PropertyMock
|
"supervisor.coresys.CoreSys.supervisor", new_callable=PropertyMock
|
||||||
) as mock:
|
) as mock:
|
||||||
|
@ -4,8 +4,8 @@ from unittest.mock import patch
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(name="mock_detect_cpu", autouse=True)
|
||||||
def mock_detect_cpu():
|
def mock_detect_cpu_fixture():
|
||||||
"""Mock cpu detection."""
|
"""Mock cpu detection."""
|
||||||
with patch("platform.machine") as detect_mock:
|
with patch("platform.machine") as detect_mock:
|
||||||
detect_mock.return_value = "Unknown"
|
detect_mock.return_value = "Unknown"
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
"""Test Tarfile functions."""
|
"""Test Tarfile functions."""
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
import pytest
|
|
||||||
|
|
||||||
from supervisor.utils.tar import secure_path, exclude_filter
|
from supervisor.utils.tar import secure_path, exclude_filter
|
||||||
|
|
||||||
|
|
||||||
@attr.s
|
@attr.s
|
||||||
class TarInfo:
|
class TarInfo:
|
||||||
"""Fake TarInfo"""
|
"""Fake TarInfo."""
|
||||||
|
|
||||||
name: str = attr.ib()
|
name: str = attr.ib()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user