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.
23 lines
773 B
Python
23 lines
773 B
Python
# -*- 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)
|