* chore(pre-commit.ci): pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.0 → v0.11.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.0...v0.11.0) * chore(pre-commit.ci): auto fixes * chore: fix violations --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org>
27 lines
760 B
Python
27 lines
760 B
Python
import pytest
|
|
|
|
from dbus_fast import aio
|
|
from dbus_fast.service import ServiceInterface
|
|
|
|
|
|
class ExampleInterface(ServiceInterface):
|
|
def __init__(self):
|
|
super().__init__("test.interface")
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_fast_disconnect():
|
|
bus_name = "aio.client.test.methods"
|
|
|
|
bus = await aio.MessageBus().connect()
|
|
bus2 = await aio.MessageBus().connect()
|
|
await bus.request_name(bus_name)
|
|
service_interface = ExampleInterface()
|
|
bus.export("/test/path", service_interface)
|
|
introspection = await bus2.introspect(bus_name, "/test/path")
|
|
bus2.get_proxy_object(bus_name, "/test/path", introspection)
|
|
bus2.disconnect()
|
|
bus.disconnect()
|
|
await bus.wait_for_disconnect()
|
|
await bus2.wait_for_disconnect()
|