test(dbus): Add unit tests for PiControl D-Bus interface
Introduces initial tests for the PiControl interface in `dbus_middleware1`. These tests cover basic functionality like checking activity status and resetting the driver while verifying IOCTL calls.
This commit is contained in:
3
tests/dbus_middleware1/process_image/__init__.py
Normal file
3
tests/dbus_middleware1/process_image/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# SPDX-FileCopyrightText: 2025 KUNBUS GmbH
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# SPDX-FileCopyrightText: 2025 KUNBUS GmbH
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
from revpi_middleware.cli_commands.dbus_helper import BusType, simple_call
|
||||
from revpi_middleware.dbus_middleware1 import extend_interface
|
||||
from tests.dbus_middleware1.bus_provider import TestBusProvider
|
||||
from tests.dbus_middleware1.fake_devices import IOCTL_QUEUE
|
||||
|
||||
|
||||
class TestObjectPicontrol(TestBusProvider):
|
||||
|
||||
def test_is_active(self):
|
||||
self.assertTrue(self.bp.running)
|
||||
|
||||
def test_reset_driver(self):
|
||||
simple_call(
|
||||
"ResetDriver",
|
||||
interface=extend_interface("picontrol"),
|
||||
bus_type=BusType.SESSION,
|
||||
)
|
||||
ioctl_call = IOCTL_QUEUE.get(timeout=2.0)
|
||||
self.assertEqual((19212, 0), ioctl_call)
|
||||
Reference in New Issue
Block a user