| 1 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 |
# |
| 3 |
# This file is formatted with Python Black |
| 4 |
# mypy: disable-error-code="misc" |
| 5 |
|
| 6 |
from tests.templates import init_logger |
| 7 |
|
| 8 |
import dbus.service |
| 9 |
|
| 10 |
|
| 11 |
BUS_NAME = "org.freedesktop.impl.portal.Test" |
| 12 |
MAIN_OBJ = "/org/freedesktop/portal/desktop" |
| 13 |
SYSTEM_BUS = False |
| 14 |
MAIN_IFACE = "org.freedesktop.impl.portal.Lockdown" |
| 15 |
|
| 16 |
|
| 17 |
logger = init_logger(__name__) |
| 18 |
|
| 19 |
|
| 20 |
def load(mock, parameters={}): |
| 21 |
logger.debug(f"Loading parameters: {parameters}") |
| 22 |
|
| 23 |
mock.AddProperties( |
| 24 |
MAIN_IFACE, |
| 25 |
dbus.Dictionary( |
| 26 |
{ |
| 27 |
"disable-printing": dbus.Boolean( |
| 28 |
parameters.get("disable-printing", False) |
| 29 |
), |
| 30 |
"disable-save-to-disk": dbus.Boolean( |
| 31 |
parameters.get("disable-save-to-disk", False) |
| 32 |
), |
| 33 |
"disable-application-handlers": dbus.Boolean( |
| 34 |
parameters.get("disable-application-handlers", False) |
| 35 |
), |
| 36 |
"disable-location": dbus.Boolean( |
| 37 |
parameters.get("disable-location", False) |
| 38 |
), |
| 39 |
"disable-camera": dbus.Boolean(parameters.get("disable-camera", False)), |
| 40 |
"disable-microphone": dbus.Boolean( |
| 41 |
parameters.get("disable-microphone", False) |
| 42 |
), |
| 43 |
"disable-sound-output": dbus.Boolean( |
| 44 |
parameters.get("disable-sound-output", False) |
| 45 |
), |
| 46 |
} |
| 47 |
), |
| 48 |
) |