Closed whot closed 2 years ago
Just ftr, I squashed in the changes requested above together with a bit of cleanup in the tests to bring them slightly closer to how https://github.com/flatpak/xdg-desktop-portal/pull/764 looks atm. Frustratingly, all these test suites are very close but not the same so they can't be fully re-used (the Xdp one provides the impl, this one here provides the portal.
Thanks, it looks great
Using python and dbusmock makes it trivial to add a large number of tests for libportal only, without requiring an actual portal implementation for the Portal interface to be tested.
Included here is the wallpaper portal as an example, hooked into meson test. A helper script is provided too for those lacking
meson devenv
,The test setup uses dbusmock interface templates (see pyportaltest/templates) to handle the actual DBus calls.
Because DBus uses a singleton for the session bus, we need libportal to specifically connect to the address given in the environment - otherwise starting mock dbus services has no effect.
This test suite depends on dbusmock commit 4a191d8ba293: "mockobject: allow sending signals with extra details"
Without this, the
EmitSignalDetailed()
method does not exist/work, but without this method we cannot receive signals.