Skip to content

Commit

Permalink
test: Added test to interface deletions
Browse files Browse the repository at this point in the history
  • Loading branch information
igo95862 committed Feb 21, 2021
1 parent 2d6c7ba commit cf6c733
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/test_sd_bus_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
DbusInterfaceCommonAsync, DbusNoReplyFlag,
dbus_method_async, dbus_method_async_override,
dbus_property_async, dbus_property_async_override,
dbus_signal_async)
dbus_signal_async, DbusUnknownObjectError)

from .common_test_util import TempDbusTest

Expand Down Expand Up @@ -365,3 +365,21 @@ class BadDbusError(DbusFailedError):
async def test_no_reply_method(self) -> None:
await wait_for(self.test_object_connection.no_reply_method('yes'),
timeout=1)

async def test_interface_remove(self) -> None:
from gc import collect

del self.test_object

collect()

loop = get_running_loop()

t = loop.create_task(self.test_object_connection.dbus_introspect())

try:
await wait_for(t, timeout=0.2)
except DbusUnknownObjectError:
...

self.assertRaises(DbusUnknownObjectError, t.result)

0 comments on commit cf6c733

Please sign in to comment.