python-dbusmock 0.32.0__tar.gz → 0.32.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/.github/workflows/tests.yml +8 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/PKG-INFO +1 -1
- python-dbusmock-0.32.2/dbusmock/_version.py +1 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/mockobject.py +6 -6
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/bluez5-obex.py +13 -13
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/bluez5.py +65 -70
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/modemmanager.py +1 -1
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/networkmanager.py +3 -5
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/ofono.py +16 -16
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/polkitd.py +1 -1
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/upower.py +32 -32
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/packaging/python-dbusmock.spec +1 -1
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/packit.yaml +1 -1
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/pyproject.toml +1 -2
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/python_dbusmock.egg-info/PKG-INFO +1 -1
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/main.fmf +3 -3
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/run-centos +5 -2
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/run-debian +6 -8
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/run-fedora +5 -2
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/run-ubuntu +6 -8
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_api.py +10 -10
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_bluez5.py +74 -8
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_code.py +1 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_iio_sensors_proxy.py +0 -2
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_logind.py +1 -1
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_modemmanager.py +0 -2
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_networkmanager.py +13 -2
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_upower.py +1 -1
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_urfkill.py +5 -5
- python-dbusmock-0.32.0/dbusmock/_version.py +0 -2
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/.fmf/version +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/.github/release.eloquent.yml +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/.github/workflows/pages.yml +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/.github/workflows/release.yml +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/.gitignore +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/.pre-commit-config.yaml +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/COPYING +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/NEWS +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/README.md +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/__init__.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/__main__.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/pytest_fixtures.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/SKELETON +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/__init__.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/gnome_screensaver.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/iio-sensors-proxy.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/logind.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/low_memory_monitor.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/notification_daemon.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/power_profiles_daemon.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/systemd.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/timedated.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/upower_power_profiles_daemon.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/templates/urfkill.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/dbusmock/testcase.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/doc/conf.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/doc/index.rst +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/plans/all.fmf +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/python_dbusmock.egg-info/SOURCES.txt +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/python_dbusmock.egg-info/dependency_links.txt +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/python_dbusmock.egg-info/requires.txt +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/python_dbusmock.egg-info/top_level.txt +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/setup.cfg +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/setup.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/__init__.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/conftest.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/run +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_api_pytest.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_cli.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_gnome_screensaver.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_low_memory_monitor.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_notification_daemon.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_ofono.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_polkitd.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_power_profiles_daemon.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_systemd.py +0 -0
- {python-dbusmock-0.32.0 → python-dbusmock-0.32.2}/tests/test_timedated.py +0 -0
|
@@ -28,6 +28,14 @@ jobs:
|
|
|
28
28
|
# need this to also fetch tags
|
|
29
29
|
fetch-depth: 0
|
|
30
30
|
|
|
31
|
+
- name: Workaround for https://github.com/actions/checkout/pull/697
|
|
32
|
+
run: |
|
|
33
|
+
set -ex
|
|
34
|
+
TAG=$(git describe --tags)
|
|
35
|
+
if echo "$TAG" | grep -q '^[0-9.]\+$'; then
|
|
36
|
+
git fetch --force origin $TAG:refs/tags/$TAG
|
|
37
|
+
fi
|
|
38
|
+
|
|
31
39
|
- name: Run unit tests
|
|
32
40
|
run: |
|
|
33
41
|
dpkg -s podman docker || true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.32.2"
|
|
@@ -23,7 +23,7 @@ import time
|
|
|
23
23
|
import types
|
|
24
24
|
from pathlib import Path
|
|
25
25
|
from typing import Any, Dict, KeysView, List, Optional, Sequence, Tuple
|
|
26
|
-
from xml.etree import ElementTree
|
|
26
|
+
from xml.etree import ElementTree as ET
|
|
27
27
|
|
|
28
28
|
import dbus
|
|
29
29
|
import dbus.service
|
|
@@ -345,7 +345,7 @@ class DBusMockObject(dbus.service.Object): # pylint: disable=too-many-instance-
|
|
|
345
345
|
dbus_proxy.AddObject('/com/example/Foo/Manager',
|
|
346
346
|
'com.example.Foo.Control',
|
|
347
347
|
{
|
|
348
|
-
'state': dbus.String('online'
|
|
348
|
+
'state': dbus.String('online'),
|
|
349
349
|
},
|
|
350
350
|
[
|
|
351
351
|
('Start', '', '', ''),
|
|
@@ -789,7 +789,7 @@ class DBusMockObject(dbus.service.Object): # pylint: disable=too-many-instance-
|
|
|
789
789
|
|
|
790
790
|
xml = dbus.service.Object.Introspect(self, object_path, connection)
|
|
791
791
|
|
|
792
|
-
tree =
|
|
792
|
+
tree = ET.fromstring(xml)
|
|
793
793
|
|
|
794
794
|
for name, name_props in self.props.items():
|
|
795
795
|
# We might have properties for new interfaces we don't know about
|
|
@@ -797,14 +797,14 @@ class DBusMockObject(dbus.service.Object): # pylint: disable=too-many-instance-
|
|
|
797
797
|
# interface to append to, and create one if we can't.
|
|
798
798
|
interface = tree.find(f".//interface[@name='{name}']")
|
|
799
799
|
if interface is None:
|
|
800
|
-
interface =
|
|
800
|
+
interface = ET.Element("interface", {"name": name})
|
|
801
801
|
tree.append(interface)
|
|
802
802
|
|
|
803
803
|
for prop, val in name_props.items():
|
|
804
804
|
if val is None:
|
|
805
805
|
# can't guess type from None, skip
|
|
806
806
|
continue
|
|
807
|
-
elem =
|
|
807
|
+
elem = ET.Element(
|
|
808
808
|
"property",
|
|
809
809
|
{
|
|
810
810
|
"name": prop,
|
|
@@ -816,7 +816,7 @@ class DBusMockObject(dbus.service.Object): # pylint: disable=too-many-instance-
|
|
|
816
816
|
|
|
817
817
|
interface.append(elem)
|
|
818
818
|
|
|
819
|
-
xml =
|
|
819
|
+
xml = ET.tostring(tree, encoding="utf8", method="xml").decode("utf8")
|
|
820
820
|
|
|
821
821
|
# restore original class table
|
|
822
822
|
self._dbus_class_table[cls] = orig_interfaces
|
|
@@ -89,11 +89,11 @@ def CreateSession(self, destination, args):
|
|
|
89
89
|
|
|
90
90
|
path = client_path + "/session" + str(session_id)
|
|
91
91
|
properties = {
|
|
92
|
-
"Source": dbus.String("FIXME"
|
|
93
|
-
"Destination": dbus.String(destination
|
|
94
|
-
"Channel": dbus.Byte(0
|
|
95
|
-
"Target": dbus.String("FIXME"
|
|
96
|
-
"Root": dbus.String("FIXME"
|
|
92
|
+
"Source": dbus.String("FIXME"),
|
|
93
|
+
"Destination": dbus.String(destination),
|
|
94
|
+
"Channel": dbus.Byte(0),
|
|
95
|
+
"Target": dbus.String("FIXME"),
|
|
96
|
+
"Root": dbus.String("FIXME"),
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
self.AddObject(
|
|
@@ -213,11 +213,11 @@ def PullAll(self, target_file, filters):
|
|
|
213
213
|
filename = Path(temp_file.name).resolve()
|
|
214
214
|
|
|
215
215
|
props = {
|
|
216
|
-
"Status": dbus.String("queued"
|
|
217
|
-
"Session": dbus.ObjectPath(session_path
|
|
218
|
-
"Name": dbus.String(target_file
|
|
219
|
-
"Filename": dbus.String(filename
|
|
220
|
-
"Transferred": dbus.UInt64(0
|
|
216
|
+
"Status": dbus.String("queued"),
|
|
217
|
+
"Session": dbus.ObjectPath(session_path),
|
|
218
|
+
"Name": dbus.String(target_file),
|
|
219
|
+
"Filename": dbus.String(filename),
|
|
220
|
+
"Transferred": dbus.UInt64(0),
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
self.AddObject(
|
|
@@ -299,7 +299,7 @@ def UpdateStatus(self, is_complete):
|
|
|
299
299
|
transferred = Path(self.props[TRANSFER_IFACE]["Filename"]).stat().st_size
|
|
300
300
|
|
|
301
301
|
self.props[TRANSFER_IFACE]["Status"] = status
|
|
302
|
-
self.props[TRANSFER_IFACE]["Transferred"] = dbus.UInt64(transferred
|
|
302
|
+
self.props[TRANSFER_IFACE]["Transferred"] = dbus.UInt64(transferred)
|
|
303
303
|
|
|
304
304
|
self.EmitSignal(
|
|
305
305
|
dbus.PROPERTIES_IFACE,
|
|
@@ -308,8 +308,8 @@ def UpdateStatus(self, is_complete):
|
|
|
308
308
|
[
|
|
309
309
|
TRANSFER_IFACE,
|
|
310
310
|
{
|
|
311
|
-
"Status": dbus.String(status
|
|
312
|
-
"Transferred": dbus.UInt64(transferred
|
|
311
|
+
"Status": dbus.String(status),
|
|
312
|
+
"Transferred": dbus.UInt64(transferred),
|
|
313
313
|
},
|
|
314
314
|
[],
|
|
315
315
|
],
|
|
@@ -155,8 +155,8 @@ def StartDiscovery(adapter):
|
|
|
155
155
|
[
|
|
156
156
|
ADAPTER_IFACE,
|
|
157
157
|
{
|
|
158
|
-
"Discoverable": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discoverable"]
|
|
159
|
-
"Discovering": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discovering"]
|
|
158
|
+
"Discoverable": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discoverable"]),
|
|
159
|
+
"Discovering": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discovering"]),
|
|
160
160
|
},
|
|
161
161
|
[],
|
|
162
162
|
],
|
|
@@ -177,8 +177,8 @@ def StopDiscovery(adapter):
|
|
|
177
177
|
[
|
|
178
178
|
ADAPTER_IFACE,
|
|
179
179
|
{
|
|
180
|
-
"Discoverable": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discoverable"]
|
|
181
|
-
"Discovering": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discovering"]
|
|
180
|
+
"Discoverable": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discoverable"]),
|
|
181
|
+
"Discovering": dbus.Boolean(adapter.props[ADAPTER_IFACE]["Discovering"]),
|
|
182
182
|
},
|
|
183
183
|
[],
|
|
184
184
|
],
|
|
@@ -221,24 +221,23 @@ def AddAdapter(self, device_name, system_name):
|
|
|
221
221
|
# Audio/Video Remote Control Profile (target)
|
|
222
222
|
"0000110c-0000-1000-8000-00805f9b34fb",
|
|
223
223
|
],
|
|
224
|
-
variant_level=1,
|
|
225
224
|
),
|
|
226
|
-
"Discoverable": dbus.Boolean(False
|
|
227
|
-
"Discovering": dbus.Boolean(False
|
|
228
|
-
"Pairable": dbus.Boolean(True
|
|
229
|
-
"Powered": dbus.Boolean(True
|
|
230
|
-
"Address": dbus.String(address
|
|
231
|
-
"AddressType": dbus.String("public"
|
|
232
|
-
"Alias": dbus.String(system_name
|
|
233
|
-
"Modalias": dbus.String("usb:v1D6Bp0245d050A"
|
|
234
|
-
"Name": dbus.String(system_name
|
|
225
|
+
"Discoverable": dbus.Boolean(False),
|
|
226
|
+
"Discovering": dbus.Boolean(False),
|
|
227
|
+
"Pairable": dbus.Boolean(True),
|
|
228
|
+
"Powered": dbus.Boolean(True),
|
|
229
|
+
"Address": dbus.String(address),
|
|
230
|
+
"AddressType": dbus.String("public"),
|
|
231
|
+
"Alias": dbus.String(system_name),
|
|
232
|
+
"Modalias": dbus.String("usb:v1D6Bp0245d050A"),
|
|
233
|
+
"Name": dbus.String(system_name),
|
|
235
234
|
# Reference:
|
|
236
235
|
# http://bluetooth-pentest.narod.ru/software/
|
|
237
236
|
# bluetooth_class_of_device-service_generator.html
|
|
238
|
-
"Class": dbus.UInt32(268
|
|
239
|
-
"DiscoverableTimeout": dbus.UInt32(180
|
|
240
|
-
"PairableTimeout": dbus.UInt32(0
|
|
241
|
-
"Roles": dbus.Array(["central", "peripheral"]
|
|
237
|
+
"Class": dbus.UInt32(268), # Computer, Laptop
|
|
238
|
+
"DiscoverableTimeout": dbus.UInt32(180),
|
|
239
|
+
"PairableTimeout": dbus.UInt32(0),
|
|
240
|
+
"Roles": dbus.Array(["central", "peripheral"]),
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
self.AddObject(
|
|
@@ -277,10 +276,10 @@ def AddAdapter(self, device_name, system_name):
|
|
|
277
276
|
if bluez.enable_advertise_api:
|
|
278
277
|
# Example values below from an Intel AX200 adapter
|
|
279
278
|
advertising_manager_properties = {
|
|
280
|
-
"ActiveInstances": dbus.Byte(0
|
|
281
|
-
"SupportedInstances": dbus.Byte(MAX_ADVERTISEMENT_INSTANCES
|
|
282
|
-
"SupportedIncludes": dbus.Array(["tx-power", "appearance", "local-name", "rssi"]
|
|
283
|
-
"SupportedSecondaryChannels": dbus.Array(["1M", "2M", "Coded"]
|
|
279
|
+
"ActiveInstances": dbus.Byte(0),
|
|
280
|
+
"SupportedInstances": dbus.Byte(MAX_ADVERTISEMENT_INSTANCES),
|
|
281
|
+
"SupportedIncludes": dbus.Array(["tx-power", "appearance", "local-name", "rssi"]),
|
|
282
|
+
"SupportedSecondaryChannels": dbus.Array(["1M", "2M", "Coded"]),
|
|
284
283
|
"SupportedCapabilities": dbus.Dictionary(
|
|
285
284
|
{
|
|
286
285
|
"MaxAdvLen": dbus.Byte(251),
|
|
@@ -289,14 +288,12 @@ def AddAdapter(self, device_name, system_name):
|
|
|
289
288
|
"MaxTxPower": dbus.Int16(7),
|
|
290
289
|
},
|
|
291
290
|
signature="sv",
|
|
292
|
-
variant_level=1,
|
|
293
291
|
),
|
|
294
292
|
"SupportedFeatures": dbus.Array(
|
|
295
293
|
[
|
|
296
294
|
"CanSetTxPower",
|
|
297
295
|
"HardwareOffload",
|
|
298
296
|
],
|
|
299
|
-
variant_level=1,
|
|
300
297
|
),
|
|
301
298
|
}
|
|
302
299
|
adapter.AddProperties(LE_ADVERTISING_MANAGER_IFACE, advertising_manager_properties)
|
|
@@ -314,7 +311,7 @@ def AddAdapter(self, device_name, system_name):
|
|
|
314
311
|
# Advertisement Monitor Manager
|
|
315
312
|
if bluez.enable_monitor_api:
|
|
316
313
|
advertisement_monitor_manager_properties = {
|
|
317
|
-
"SupportedMonitorTypes": dbus.Array(["or_patterns"]
|
|
314
|
+
"SupportedMonitorTypes": dbus.Array(["or_patterns"]),
|
|
318
315
|
}
|
|
319
316
|
adapter.AddProperties(ADVERTISEMENT_MONITOR_MANAGER_IFACE, advertisement_monitor_manager_properties)
|
|
320
317
|
adapter.AddMethods(
|
|
@@ -423,7 +420,7 @@ def Connect(device):
|
|
|
423
420
|
[
|
|
424
421
|
DEVICE_IFACE,
|
|
425
422
|
{
|
|
426
|
-
"Connected": dbus.Boolean(device.connected
|
|
423
|
+
"Connected": dbus.Boolean(device.connected),
|
|
427
424
|
},
|
|
428
425
|
[],
|
|
429
426
|
],
|
|
@@ -442,7 +439,7 @@ def Disconnect(device):
|
|
|
442
439
|
[
|
|
443
440
|
DEVICE_IFACE,
|
|
444
441
|
{
|
|
445
|
-
"Connected": dbus.Boolean(device.connected
|
|
442
|
+
"Connected": dbus.Boolean(device.connected),
|
|
446
443
|
},
|
|
447
444
|
[],
|
|
448
445
|
],
|
|
@@ -474,29 +471,29 @@ def AddDevice(self, adapter_device_name, device_address, alias):
|
|
|
474
471
|
)
|
|
475
472
|
|
|
476
473
|
properties = {
|
|
477
|
-
"Address": dbus.String(device_address
|
|
478
|
-
"AddressType": dbus.String("public"
|
|
479
|
-
"Name": dbus.String(alias
|
|
480
|
-
"Icon": dbus.String("phone"
|
|
481
|
-
"Class": dbus.UInt32(MOCK_PHONE_CLASS
|
|
482
|
-
"Appearance": dbus.UInt16(0
|
|
483
|
-
"UUIDs": dbus.Array([], signature="s"
|
|
484
|
-
"Paired": dbus.Boolean(False
|
|
485
|
-
"Connected": dbus.Boolean(False
|
|
486
|
-
"Trusted": dbus.Boolean(False
|
|
487
|
-
"Blocked": dbus.Boolean(False
|
|
488
|
-
"WakeAllowed": dbus.Boolean(False
|
|
489
|
-
"Alias": dbus.String(alias
|
|
490
|
-
"Adapter": dbus.ObjectPath(adapter_path
|
|
491
|
-
"LegacyPairing": dbus.Boolean(False
|
|
492
|
-
"Modalias": dbus.String("bluetooth:v000Fp1200d1436"
|
|
493
|
-
"RSSI": dbus.Int16(-79
|
|
494
|
-
"TxPower": dbus.Int16(0
|
|
495
|
-
"ManufacturerData": dbus.Array([], signature="a{qv}"
|
|
496
|
-
"ServiceData": dbus.Array([], signature="a{sv}"
|
|
497
|
-
"ServicesResolved": dbus.Boolean(False
|
|
498
|
-
"AdvertisingFlags": dbus.Array([], signature="ay"
|
|
499
|
-
"AdvertisingData": dbus.Array([], signature="a{yv}"
|
|
474
|
+
"Address": dbus.String(device_address),
|
|
475
|
+
"AddressType": dbus.String("public"),
|
|
476
|
+
"Name": dbus.String(alias),
|
|
477
|
+
"Icon": dbus.String("phone"),
|
|
478
|
+
"Class": dbus.UInt32(MOCK_PHONE_CLASS),
|
|
479
|
+
"Appearance": dbus.UInt16(0),
|
|
480
|
+
"UUIDs": dbus.Array([], signature="s"),
|
|
481
|
+
"Paired": dbus.Boolean(False),
|
|
482
|
+
"Connected": dbus.Boolean(False),
|
|
483
|
+
"Trusted": dbus.Boolean(False),
|
|
484
|
+
"Blocked": dbus.Boolean(False),
|
|
485
|
+
"WakeAllowed": dbus.Boolean(False),
|
|
486
|
+
"Alias": dbus.String(alias),
|
|
487
|
+
"Adapter": dbus.ObjectPath(adapter_path),
|
|
488
|
+
"LegacyPairing": dbus.Boolean(False),
|
|
489
|
+
"Modalias": dbus.String("bluetooth:v000Fp1200d1436"),
|
|
490
|
+
"RSSI": dbus.Int16(-79), # arbitrary
|
|
491
|
+
"TxPower": dbus.Int16(0),
|
|
492
|
+
"ManufacturerData": dbus.Array([], signature="a{qv}"),
|
|
493
|
+
"ServiceData": dbus.Array([], signature="a{sv}"),
|
|
494
|
+
"ServicesResolved": dbus.Boolean(False),
|
|
495
|
+
"AdvertisingFlags": dbus.Array([], signature="ay"),
|
|
496
|
+
"AdvertisingData": dbus.Array([], signature="a{yv}"),
|
|
500
497
|
}
|
|
501
498
|
|
|
502
499
|
self.AddObject(
|
|
@@ -579,10 +576,10 @@ def PairDevice(_self, adapter_device_name, device_address):
|
|
|
579
576
|
device.UpdateProperties(
|
|
580
577
|
DEVICE_IFACE,
|
|
581
578
|
{
|
|
582
|
-
"UUIDs": dbus.Array(uuids
|
|
583
|
-
"Paired": dbus.Boolean(True
|
|
584
|
-
"LegacyPairing": dbus.Boolean(True
|
|
585
|
-
"Blocked": dbus.Boolean(False
|
|
579
|
+
"UUIDs": dbus.Array(uuids),
|
|
580
|
+
"Paired": dbus.Boolean(True),
|
|
581
|
+
"LegacyPairing": dbus.Boolean(True),
|
|
582
|
+
"Blocked": dbus.Boolean(False),
|
|
586
583
|
},
|
|
587
584
|
)
|
|
588
585
|
|
|
@@ -617,8 +614,8 @@ def BlockDevice(_self, adapter_device_name, device_address):
|
|
|
617
614
|
|
|
618
615
|
device = mockobject.objects[device_path]
|
|
619
616
|
|
|
620
|
-
device.props[DEVICE_IFACE]["Blocked"] = dbus.Boolean(True
|
|
621
|
-
device.props[DEVICE_IFACE]["Connected"] = dbus.Boolean(False
|
|
617
|
+
device.props[DEVICE_IFACE]["Blocked"] = dbus.Boolean(True)
|
|
618
|
+
device.props[DEVICE_IFACE]["Connected"] = dbus.Boolean(False)
|
|
622
619
|
|
|
623
620
|
device.EmitSignal(
|
|
624
621
|
dbus.PROPERTIES_IFACE,
|
|
@@ -627,8 +624,8 @@ def BlockDevice(_self, adapter_device_name, device_address):
|
|
|
627
624
|
[
|
|
628
625
|
DEVICE_IFACE,
|
|
629
626
|
{
|
|
630
|
-
"Blocked": dbus.Boolean(True
|
|
631
|
-
"Connected": dbus.Boolean(False
|
|
627
|
+
"Blocked": dbus.Boolean(True),
|
|
628
|
+
"Connected": dbus.Boolean(False),
|
|
632
629
|
},
|
|
633
630
|
[],
|
|
634
631
|
],
|
|
@@ -665,8 +662,8 @@ def ConnectDevice(_self, adapter_device_name, device_address):
|
|
|
665
662
|
|
|
666
663
|
device = mockobject.objects[device_path]
|
|
667
664
|
|
|
668
|
-
device.props[DEVICE_IFACE]["Blocked"] = dbus.Boolean(False
|
|
669
|
-
device.props[DEVICE_IFACE]["Connected"] = dbus.Boolean(True
|
|
665
|
+
device.props[DEVICE_IFACE]["Blocked"] = dbus.Boolean(False)
|
|
666
|
+
device.props[DEVICE_IFACE]["Connected"] = dbus.Boolean(True)
|
|
670
667
|
|
|
671
668
|
device.EmitSignal(
|
|
672
669
|
dbus.PROPERTIES_IFACE,
|
|
@@ -675,8 +672,8 @@ def ConnectDevice(_self, adapter_device_name, device_address):
|
|
|
675
672
|
[
|
|
676
673
|
DEVICE_IFACE,
|
|
677
674
|
{
|
|
678
|
-
"Blocked": dbus.Boolean(False
|
|
679
|
-
"Connected": dbus.Boolean(True
|
|
675
|
+
"Blocked": dbus.Boolean(False),
|
|
676
|
+
"Connected": dbus.Boolean(True),
|
|
680
677
|
},
|
|
681
678
|
[],
|
|
682
679
|
],
|
|
@@ -713,7 +710,7 @@ def DisconnectDevice(_self, adapter_device_name, device_address):
|
|
|
713
710
|
|
|
714
711
|
device = mockobject.objects[device_path]
|
|
715
712
|
|
|
716
|
-
device.props[DEVICE_IFACE]["Connected"] = dbus.Boolean(False
|
|
713
|
+
device.props[DEVICE_IFACE]["Connected"] = dbus.Boolean(False)
|
|
717
714
|
|
|
718
715
|
device.EmitSignal(
|
|
719
716
|
dbus.PROPERTIES_IFACE,
|
|
@@ -722,7 +719,7 @@ def DisconnectDevice(_self, adapter_device_name, device_address):
|
|
|
722
719
|
[
|
|
723
720
|
DEVICE_IFACE,
|
|
724
721
|
{
|
|
725
|
-
"Connected": dbus.Boolean(False
|
|
722
|
+
"Connected": dbus.Boolean(False),
|
|
726
723
|
},
|
|
727
724
|
[],
|
|
728
725
|
],
|
|
@@ -778,14 +775,13 @@ def AddAdvertisement(self, adv_name):
|
|
|
778
775
|
path = "/org/dbusmock/bluez/advertisement/" + adv_name
|
|
779
776
|
|
|
780
777
|
adv_properties = {
|
|
781
|
-
"Type": dbus.String("broadcast"
|
|
778
|
+
"Type": dbus.String("broadcast"),
|
|
782
779
|
"ManufacturerData": dbus.Dictionary(
|
|
783
780
|
# 0xFFFF is the Bluetooth Company Identifier reserved for internal use and testing.
|
|
784
|
-
{dbus.UInt16(0xFFFF): dbus.Array([0x00, 0x01]
|
|
781
|
+
{dbus.UInt16(0xFFFF): dbus.Array([0x00, 0x01])},
|
|
785
782
|
signature="qv",
|
|
786
|
-
variant_level=1,
|
|
787
783
|
),
|
|
788
|
-
"Includes": dbus.Array(["local-name"]
|
|
784
|
+
"Includes": dbus.Array(["local-name"]),
|
|
789
785
|
}
|
|
790
786
|
|
|
791
787
|
self.AddObject(
|
|
@@ -809,7 +805,7 @@ def AddMonitor(self, monitor_name):
|
|
|
809
805
|
path = "/org/dbusmock/bluez/monitor/" + monitor_name
|
|
810
806
|
|
|
811
807
|
monitor_properties = {
|
|
812
|
-
"Type": dbus.String("or_patterns"
|
|
808
|
+
"Type": dbus.String("or_patterns"),
|
|
813
809
|
# Example pattern that could be used to scan for an advertisement created by AddAdvertisement()
|
|
814
810
|
"Patterns": dbus.Struct(
|
|
815
811
|
(
|
|
@@ -826,7 +822,6 @@ def AddMonitor(self, monitor_name):
|
|
|
826
822
|
),
|
|
827
823
|
),
|
|
828
824
|
signature="yyay",
|
|
829
|
-
variant_level=2,
|
|
830
825
|
),
|
|
831
826
|
}
|
|
832
827
|
|
|
@@ -155,7 +155,7 @@ def AddSimpleModem(self):
|
|
|
155
155
|
self.AddObject(modem_path, MODEM_IFACE, modem_props, [])
|
|
156
156
|
|
|
157
157
|
modem_3gpp_props = {
|
|
158
|
-
"Imei": dbus.String("doesnotmatter"
|
|
158
|
+
"Imei": dbus.String("doesnotmatter"),
|
|
159
159
|
"OperatorName": dbus.String("TheOperator"),
|
|
160
160
|
"Pco": dbus.Array([], signature="(ubay)"),
|
|
161
161
|
}
|
|
@@ -285,20 +285,18 @@ def SetProperty(_self, path, iface, name, value):
|
|
|
285
285
|
|
|
286
286
|
@dbus.service.method(MOCK_IFACE, in_signature="u", out_signature="")
|
|
287
287
|
def SetGlobalConnectionState(self, state):
|
|
288
|
-
self.SetProperty(MANAGER_OBJ, MANAGER_IFACE, "State", dbus.UInt32(state
|
|
288
|
+
self.SetProperty(MANAGER_OBJ, MANAGER_IFACE, "State", dbus.UInt32(state))
|
|
289
289
|
self.EmitSignal(MANAGER_IFACE, "StateChanged", "u", [state])
|
|
290
290
|
|
|
291
291
|
|
|
292
292
|
@dbus.service.method(MOCK_IFACE, in_signature="u", out_signature="")
|
|
293
293
|
def SetConnectivity(self, connectivity):
|
|
294
|
-
self.SetProperty(MANAGER_OBJ, MANAGER_IFACE, "Connectivity", dbus.UInt32(connectivity
|
|
294
|
+
self.SetProperty(MANAGER_OBJ, MANAGER_IFACE, "Connectivity", dbus.UInt32(connectivity))
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
@dbus.service.method(MOCK_IFACE, in_signature="b", out_signature="")
|
|
298
298
|
def SetNetworkingEnabled(self, networking_enabled):
|
|
299
|
-
self.SetProperty(
|
|
300
|
-
MANAGER_OBJ, MANAGER_IFACE, "NetworkingEnabled", dbus.Boolean(networking_enabled, variant_level=1)
|
|
301
|
-
)
|
|
299
|
+
self.SetProperty(MANAGER_OBJ, MANAGER_IFACE, "NetworkingEnabled", dbus.Boolean(networking_enabled))
|
|
302
300
|
|
|
303
301
|
|
|
304
302
|
@dbus.service.method(MOCK_IFACE, in_signature="ss", out_signature="")
|
|
@@ -82,15 +82,15 @@ def AddModem(self, name, _properties):
|
|
|
82
82
|
path,
|
|
83
83
|
"org.ofono.Modem",
|
|
84
84
|
{
|
|
85
|
-
"Online": dbus.Boolean(True
|
|
86
|
-
"Powered": dbus.Boolean(True
|
|
87
|
-
"Lockdown": dbus.Boolean(False
|
|
88
|
-
"Emergency": dbus.Boolean(False
|
|
89
|
-
"Manufacturer": dbus.String("Fakesys"
|
|
90
|
-
"Model": dbus.String("Mock Modem"
|
|
91
|
-
"Revision": dbus.String("0815.42"
|
|
92
|
-
"Serial": dbus.String(new_modem_serial(self)
|
|
93
|
-
"Type": dbus.String("hardware"
|
|
85
|
+
"Online": dbus.Boolean(True),
|
|
86
|
+
"Powered": dbus.Boolean(True),
|
|
87
|
+
"Lockdown": dbus.Boolean(False),
|
|
88
|
+
"Emergency": dbus.Boolean(False),
|
|
89
|
+
"Manufacturer": dbus.String("Fakesys"),
|
|
90
|
+
"Model": dbus.String("Mock Modem"),
|
|
91
|
+
"Revision": dbus.String("0815.42"),
|
|
92
|
+
"Serial": dbus.String(new_modem_serial(self)),
|
|
93
|
+
"Type": dbus.String("hardware"),
|
|
94
94
|
"Interfaces": [
|
|
95
95
|
"org.ofono.CallVolume",
|
|
96
96
|
"org.ofono.VoiceCallManager",
|
|
@@ -220,13 +220,13 @@ def Dial(self, number, _hide_callerid):
|
|
|
220
220
|
path,
|
|
221
221
|
"org.ofono.VoiceCall",
|
|
222
222
|
{
|
|
223
|
-
"State": dbus.String("dialing"
|
|
224
|
-
"LineIdentification": dbus.String(number
|
|
225
|
-
"Name": dbus.String(""
|
|
226
|
-
"Multiparty": dbus.Boolean(False
|
|
227
|
-
"RemoteHeld": dbus.Boolean(False
|
|
228
|
-
"RemoteMultiparty": dbus.Boolean(False
|
|
229
|
-
"Emergency": dbus.Boolean(False
|
|
223
|
+
"State": dbus.String("dialing"),
|
|
224
|
+
"LineIdentification": dbus.String(number),
|
|
225
|
+
"Name": dbus.String(""),
|
|
226
|
+
"Multiparty": dbus.Boolean(False),
|
|
227
|
+
"RemoteHeld": dbus.Boolean(False),
|
|
228
|
+
"RemoteMultiparty": dbus.Boolean(False),
|
|
229
|
+
"Emergency": dbus.Boolean(False),
|
|
230
230
|
},
|
|
231
231
|
[
|
|
232
232
|
("GetProperties", "", "a{sv}", 'ret = self.GetAll("org.ofono.VoiceCall")'),
|
|
@@ -73,18 +73,18 @@ def load(mock, parameters):
|
|
|
73
73
|
mock.p_display_dev,
|
|
74
74
|
DEVICE_IFACE,
|
|
75
75
|
{
|
|
76
|
-
"Type": dbus.UInt32(0
|
|
77
|
-
"State": dbus.UInt32(0
|
|
78
|
-
"Percentage": dbus.Double(0.0
|
|
79
|
-
"Energy": dbus.Double(0.0
|
|
80
|
-
"EnergyFull": dbus.Double(0.0
|
|
81
|
-
"EnergyRate": dbus.Double(0.0
|
|
82
|
-
"TimeToEmpty": dbus.Int64(0
|
|
83
|
-
"TimeToFull": dbus.Int64(0
|
|
84
|
-
"IsPresent": dbus.Boolean(False
|
|
85
|
-
"IconName": dbus.String(""
|
|
76
|
+
"Type": dbus.UInt32(0),
|
|
77
|
+
"State": dbus.UInt32(0),
|
|
78
|
+
"Percentage": dbus.Double(0.0),
|
|
79
|
+
"Energy": dbus.Double(0.0),
|
|
80
|
+
"EnergyFull": dbus.Double(0.0),
|
|
81
|
+
"EnergyRate": dbus.Double(0.0),
|
|
82
|
+
"TimeToEmpty": dbus.Int64(0),
|
|
83
|
+
"TimeToFull": dbus.Int64(0),
|
|
84
|
+
"IsPresent": dbus.Boolean(False),
|
|
85
|
+
"IconName": dbus.String(""),
|
|
86
86
|
# LEVEL_NONE
|
|
87
|
-
"WarningLevel": dbus.UInt32(1
|
|
87
|
+
"WarningLevel": dbus.UInt32(1),
|
|
88
88
|
},
|
|
89
89
|
[
|
|
90
90
|
("Refresh", "", "", ""),
|
|
@@ -111,9 +111,9 @@ def AddAC(self, device_name, model_name):
|
|
|
111
111
|
path,
|
|
112
112
|
DEVICE_IFACE,
|
|
113
113
|
{
|
|
114
|
-
"PowerSupply": dbus.Boolean(True
|
|
115
|
-
"Model": dbus.String(model_name
|
|
116
|
-
"Online": dbus.Boolean(True
|
|
114
|
+
"PowerSupply": dbus.Boolean(True),
|
|
115
|
+
"Model": dbus.String(model_name),
|
|
116
|
+
"Online": dbus.Boolean(True),
|
|
117
117
|
},
|
|
118
118
|
[],
|
|
119
119
|
)
|
|
@@ -139,17 +139,17 @@ def AddDischargingBattery(self, device_name, model_name, percentage, seconds_to_
|
|
|
139
139
|
path,
|
|
140
140
|
DEVICE_IFACE,
|
|
141
141
|
{
|
|
142
|
-
"PowerSupply": dbus.Boolean(True
|
|
143
|
-
"IsPresent": dbus.Boolean(True
|
|
144
|
-
"Model": dbus.String(model_name
|
|
145
|
-
"Percentage": dbus.Double(percentage
|
|
146
|
-
"TimeToEmpty": dbus.Int64(seconds_to_empty
|
|
147
|
-
"EnergyFull": dbus.Double(100.0
|
|
148
|
-
"Energy": dbus.Double(percentage
|
|
142
|
+
"PowerSupply": dbus.Boolean(True),
|
|
143
|
+
"IsPresent": dbus.Boolean(True),
|
|
144
|
+
"Model": dbus.String(model_name),
|
|
145
|
+
"Percentage": dbus.Double(percentage),
|
|
146
|
+
"TimeToEmpty": dbus.Int64(seconds_to_empty),
|
|
147
|
+
"EnergyFull": dbus.Double(100.0),
|
|
148
|
+
"Energy": dbus.Double(percentage),
|
|
149
149
|
# UP_DEVICE_STATE_DISCHARGING
|
|
150
|
-
"State": dbus.UInt32(2
|
|
150
|
+
"State": dbus.UInt32(2),
|
|
151
151
|
# UP_DEVICE_KIND_BATTERY
|
|
152
|
-
"Type": dbus.UInt32(2
|
|
152
|
+
"Type": dbus.UInt32(2),
|
|
153
153
|
},
|
|
154
154
|
[],
|
|
155
155
|
)
|
|
@@ -175,17 +175,17 @@ def AddChargingBattery(self, device_name, model_name, percentage, seconds_to_ful
|
|
|
175
175
|
path,
|
|
176
176
|
DEVICE_IFACE,
|
|
177
177
|
{
|
|
178
|
-
"PowerSupply": dbus.Boolean(True
|
|
179
|
-
"IsPresent": dbus.Boolean(True
|
|
180
|
-
"Model": dbus.String(model_name
|
|
181
|
-
"Percentage": dbus.Double(percentage
|
|
182
|
-
"TimeToFull": dbus.Int64(seconds_to_full
|
|
183
|
-
"EnergyFull": dbus.Double(100.0
|
|
184
|
-
"Energy": dbus.Double(percentage
|
|
178
|
+
"PowerSupply": dbus.Boolean(True),
|
|
179
|
+
"IsPresent": dbus.Boolean(True),
|
|
180
|
+
"Model": dbus.String(model_name),
|
|
181
|
+
"Percentage": dbus.Double(percentage),
|
|
182
|
+
"TimeToFull": dbus.Int64(seconds_to_full),
|
|
183
|
+
"EnergyFull": dbus.Double(100.0),
|
|
184
|
+
"Energy": dbus.Double(percentage),
|
|
185
185
|
# UP_DEVICE_STATE_CHARGING
|
|
186
|
-
"State": dbus.UInt32(1
|
|
186
|
+
"State": dbus.UInt32(1),
|
|
187
187
|
# UP_DEVICE_KIND_BATTERY
|
|
188
|
-
"Type": dbus.UInt32(2
|
|
188
|
+
"Type": dbus.UInt32(2),
|
|
189
189
|
},
|
|
190
190
|
[],
|
|
191
191
|
)
|
|
@@ -12,7 +12,7 @@ actions:
|
|
|
12
12
|
create-archive:
|
|
13
13
|
- ./setup.py sdist
|
|
14
14
|
# spec and tarball need to be in the same directory
|
|
15
|
-
- sh -c 'mv dist/*.tar.* packaging; ls packaging/python-dbusmock-*.tar.*'
|
|
15
|
+
- sh -c 'mv dist/*.tar.* packaging; ls packaging/python[-_]dbusmock-*.tar.*'
|
|
16
16
|
|
|
17
17
|
srpm_build_deps:
|
|
18
18
|
- python3-setuptools
|
|
@@ -36,8 +36,7 @@ packages = ["dbusmock", "dbusmock.templates"]
|
|
|
36
36
|
|
|
37
37
|
[tool.setuptools_scm]
|
|
38
38
|
write_to = "dbusmock/_version.py"
|
|
39
|
-
|
|
40
|
-
write_to_template = """'''auto-generated version from setuptools_scm'''
|
|
39
|
+
write_to_template = """
|
|
41
40
|
__version__ = "{version}"
|
|
42
41
|
"""
|
|
43
42
|
version_scheme = 'post-release'
|