Skip to content

Commit

Permalink
tests/documents: Add document portal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swick authored and GeorgesStavracas committed Jan 24, 2025
1 parent c548e82 commit 025173a
Show file tree
Hide file tree
Showing 3 changed files with 393 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ def get_permission_store_iface(bus: dbus.Bus) -> dbus.Interface:
return dbus.Interface(obj, "org.freedesktop.impl.portal.PermissionStore")


def get_document_portal_iface(bus: dbus.Bus) -> dbus.Interface:
"""
Returns the dbus interface of the xdg-document-portal.
"""
obj = bus.get_object(
"org.freedesktop.portal.Documents",
"/org/freedesktop/portal/documents",
)
return dbus.Interface(obj, "org.freedesktop.portal.Documents")


def get_mock_iface(bus: dbus.Bus, bus_name: Optional[str] = None) -> dbus.Interface:
"""
Returns the mock interface of the xdg-desktop-portal.
Expand Down
1 change: 1 addition & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ if enable_pytest
'test_background.py',
'test_camera.py',
'test_clipboard.py',
'test_documents.py',
'test_document_fuse.py',
'test_email.py',
'test_filechooser.py',
Expand Down
Loading

0 comments on commit 025173a

Please sign in to comment.