File: test_aio_multi_flags.py

package info (click to toggle)
dbus-fast 4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,816 kB
  • sloc: python: 10,129; xml: 39; makefile: 29; sh: 5
file content (25 lines) | stat: -rw-r--r-- 720 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import asyncio

import pytest

from dbus_fast.aio import MessageBus
from dbus_fast.annotations import DBusStr
from dbus_fast.service import ServiceInterface, dbus_method


@pytest.mark.asyncio
async def test_multiple_flags_in_message():
    class ExampleInterface(ServiceInterface):
        def __init__(self, name: str) -> None:
            super().__init__(name)

        @dbus_method()
        def Echo(self, what: DBusStr) -> DBusStr:
            return what

    bus = await MessageBus().connect()
    interface = ExampleInterface("test.interface")
    bus.export("/test/path", interface)
    await bus.request_name("test.name")
    bus.disconnect()
    await asyncio.wait_for(bus.wait_for_disconnect(), timeout=1)