mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 20:35:55 +00:00
Use session dbus mocks for all tests (#4198)
* Use session dbus mocks for all tests * func instead of fn for pylint
This commit is contained in:
@@ -6,8 +6,8 @@ import pytest
|
||||
from supervisor.dbus.agent import OSAgent
|
||||
from supervisor.exceptions import DBusNotConnectedError
|
||||
|
||||
from tests.dbus_service_mocks.agent_cgroup import CGroup as CGroupService
|
||||
from tests.dbus_service_mocks.base import DBusServiceMock
|
||||
from tests.dbus_service_mocks.cgroup import CGroup as CGroupService
|
||||
|
||||
|
||||
@pytest.fixture(name="cgroup_service", autouse=True)
|
||||
@@ -15,13 +15,14 @@ async def fixture_cgroup_service(
|
||||
os_agent_services: dict[str, DBusServiceMock]
|
||||
) -> CGroupService:
|
||||
"""Mock CGroup dbus service."""
|
||||
yield os_agent_services["cgroup"]
|
||||
yield os_agent_services["agent_cgroup"]
|
||||
|
||||
|
||||
async def test_dbus_osagent_cgroup_add_devices(
|
||||
cgroup_service: CGroupService, dbus_session_bus: MessageBus
|
||||
):
|
||||
"""Test wipe data partition on host."""
|
||||
cgroup_service.AddDevicesAllowed.calls.clear()
|
||||
os_agent = OSAgent()
|
||||
|
||||
with pytest.raises(DBusNotConnectedError):
|
||||
|
||||
Reference in New Issue
Block a user