python-dbusmock 0.35.0__tar.gz → 0.36.0__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.
Files changed (80) hide show
  1. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/.github/workflows/tests.yml +0 -1
  2. {python_dbusmock-0.35.0/python_dbusmock.egg-info → python_dbusmock-0.36.0}/PKG-INFO +1 -5
  3. python_dbusmock-0.36.0/dbusmock/_version.py +1 -0
  4. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/mockobject.py +6 -3
  5. {python_dbusmock-0.35.0/packaging → python_dbusmock-0.36.0/distro}/python-dbusmock.spec +9 -4
  6. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/packit.yaml +5 -3
  7. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0/python_dbusmock.egg-info}/PKG-INFO +1 -5
  8. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/python_dbusmock.egg-info/SOURCES.txt +1 -3
  9. python_dbusmock-0.36.0/setup.cfg +4 -0
  10. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/run-centos +2 -1
  11. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/run-fedora +2 -1
  12. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_api.py +34 -10
  13. python_dbusmock-0.35.0/dbusmock/_version.py +0 -1
  14. python_dbusmock-0.35.0/setup.cfg +0 -35
  15. python_dbusmock-0.35.0/setup.py +0 -7
  16. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/.fmf/version +0 -0
  17. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/.github/release.eloquent.yml +0 -0
  18. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/.github/workflows/pages.yml +0 -0
  19. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/.github/workflows/release.yml +0 -0
  20. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/.gitignore +0 -0
  21. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/.pre-commit-config.yaml +0 -0
  22. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/COPYING +0 -0
  23. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/NEWS +0 -0
  24. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/README.md +0 -0
  25. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/__init__.py +0 -0
  26. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/__main__.py +0 -0
  27. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/pytest_fixtures.py +0 -0
  28. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/SKELETON +0 -0
  29. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/__init__.py +0 -0
  30. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/bluez5-obex.py +0 -0
  31. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/bluez5.py +0 -0
  32. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/gnome_screensaver.py +0 -0
  33. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/gsd_rfkill.py +0 -0
  34. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/iio-sensors-proxy.py +0 -0
  35. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/logind.py +0 -0
  36. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/low_memory_monitor.py +0 -0
  37. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/modemmanager.py +0 -0
  38. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/networkmanager.py +0 -0
  39. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/notification_daemon.py +0 -0
  40. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/ofono.py +0 -0
  41. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/polkitd.py +0 -0
  42. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/power_profiles_daemon.py +0 -0
  43. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/systemd.py +0 -0
  44. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/timedated.py +0 -0
  45. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/upower.py +0 -0
  46. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/upower_power_profiles_daemon.py +0 -0
  47. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/templates/urfkill.py +0 -0
  48. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/dbusmock/testcase.py +0 -0
  49. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/doc/conf.py +0 -0
  50. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/doc/index.rst +0 -0
  51. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/plans/all.fmf +0 -0
  52. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/pyproject.toml +0 -0
  53. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/python_dbusmock.egg-info/dependency_links.txt +0 -0
  54. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/python_dbusmock.egg-info/requires.txt +0 -0
  55. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/python_dbusmock.egg-info/top_level.txt +0 -0
  56. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/__init__.py +0 -0
  57. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/conftest.py +0 -0
  58. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/main.fmf +0 -0
  59. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/run +0 -0
  60. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/run-debian +0 -0
  61. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/run-ubuntu +0 -0
  62. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_api_pytest.py +0 -0
  63. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_bluez5.py +0 -0
  64. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_cli.py +0 -0
  65. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_code.py +0 -0
  66. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_gnome_screensaver.py +0 -0
  67. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_gsd_rfkill.py +0 -0
  68. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_iio_sensors_proxy.py +0 -0
  69. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_logind.py +0 -0
  70. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_low_memory_monitor.py +0 -0
  71. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_modemmanager.py +0 -0
  72. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_networkmanager.py +0 -0
  73. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_notification_daemon.py +0 -0
  74. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_ofono.py +0 -0
  75. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_polkitd.py +0 -0
  76. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_power_profiles_daemon.py +0 -0
  77. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_systemd.py +0 -0
  78. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_timedated.py +0 -0
  79. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_upower.py +0 -0
  80. {python_dbusmock-0.35.0 → python_dbusmock-0.36.0}/tests/test_urfkill.py +0 -0
@@ -17,7 +17,6 @@ jobs:
17
17
  - docker.io/ubuntu:latest
18
18
  - registry.fedoraproject.org/fedora:latest
19
19
  - registry.fedoraproject.org/fedora:rawhide
20
- - quay.io/centos/centos:stream9
21
20
  - quay.io/centos/centos:stream10-development
22
21
 
23
22
  timeout-minutes: 30
@@ -1,10 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-dbusmock
3
- Version: 0.35.0
3
+ Version: 0.36.0
4
4
  Summary: Mock D-Bus objects
5
- Home-page: https://github.com/martinpitt/python-dbusmock
6
- Download-URL: https://pypi.python.org/pypi/python-dbusmock/
7
- Author: Martin Pitt
8
5
  Author-email: Martin Pitt <martin@piware.de>
9
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
10
7
  Version 3, 29 June 2007
@@ -188,7 +185,6 @@ Requires-Python: >=3.8
188
185
  Description-Content-Type: text/markdown
189
186
  License-File: COPYING
190
187
  Requires-Dist: dbus-python
191
- Dynamic: download-url
192
188
  Dynamic: license-file
193
189
 
194
190
  ![CI status](https://github.com/martinpitt/python-dbusmock/actions/workflows/tests.yml/badge.svg)
@@ -0,0 +1 @@
1
+ __version__ = "0.36.0"
@@ -116,10 +116,8 @@ def _wrap_in_dbus_variant(value):
116
116
  dbus.types.ByteArray,
117
117
  dbus.types.Int16,
118
118
  dbus.types.ObjectPath,
119
- dbus.types.Struct,
120
119
  dbus.types.UInt64,
121
120
  dbus.types.Boolean,
122
- dbus.types.Dictionary,
123
121
  dbus.types.Int32,
124
122
  dbus.types.Signature,
125
123
  dbus.types.UInt16,
@@ -130,9 +128,14 @@ def _wrap_in_dbus_variant(value):
130
128
  dbus.types.String,
131
129
  dbus.types.UInt32,
132
130
  ]
131
+ container_types = [
132
+ dbus.types.Array,
133
+ dbus.types.Struct,
134
+ dbus.types.Dictionary,
135
+ ]
133
136
  if isinstance(value, dbus.String):
134
137
  return dbus.String(str(value), variant_level=1)
135
- if isinstance(value, dbus.types.Array):
138
+ if type(value) in container_types:
136
139
  return value
137
140
  if type(value) in dbus_types:
138
141
  return type(value)(value.conjugate(), variant_level=1)
@@ -13,6 +13,8 @@ BuildArch: noarch
13
13
  BuildRequires: git
14
14
  BuildRequires: python3-dbus
15
15
  BuildRequires: python3-devel
16
+ BuildRequires: python3dist(setuptools-scm)
17
+ BuildRequires: python3dist(wheel)
16
18
  BuildRequires: python3-setuptools
17
19
  BuildRequires: python3-gobject
18
20
  BuildRequires: python3-pytest
@@ -37,18 +39,21 @@ Requires: python3-dbus, python3-gobject, dbus-x11
37
39
  %autosetup -n python_%{modname}-%{version}
38
40
  rm -rf python-%{modname}.egg-info
39
41
 
42
+ %generate_buildrequires
43
+ %pyproject_buildrequires
40
44
 
41
45
  %build
42
- %py3_build
46
+ %pyproject_wheel
43
47
 
44
48
  %install
45
- %py3_install
49
+ %pyproject_install
50
+ %pyproject_save_files -l dbusmock
46
51
 
47
52
  %check
48
53
  %{__python3} -m unittest -v
49
54
 
50
- %files -n python3-dbusmock
55
+ %files -n python3-dbusmock -f %{pyproject_files}
56
+
51
57
  %doc README.md COPYING
52
- %{python3_sitelib}/*%{modname}*
53
58
 
54
59
  %changelog
@@ -2,7 +2,7 @@
2
2
  # https://packit.dev/docs/configuration/
3
3
  upstream_project_url: https://github.com/martinpitt/python-dbusmock
4
4
  # HACK: should work without, but propose_downstream fails; https://github.com/packit/packit-service/issues/1511
5
- specfile_path: packaging/python-dbusmock.spec
5
+ specfile_path: distro/python-dbusmock.spec
6
6
  issue_repository: https://github.com/martinpitt/python-dbusmock
7
7
  copy_upstream_release_description: true
8
8
  upstream_package_name: python-dbusmock
@@ -12,7 +12,7 @@ actions:
12
12
  create-archive:
13
13
  - python3 -m build --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.* distro; ls distro/python_dbusmock-*.tar.*'
16
16
 
17
17
  srpm_build_deps:
18
18
  - python3-build
@@ -28,12 +28,14 @@ jobs:
28
28
  - fedora-latest-ppc64le
29
29
  - fedora-latest-s390x
30
30
  - fedora-latest-armhfp
31
+ # needed for tests
32
+ - fedora-all
33
+ - centos-stream-10-x86_64
31
34
 
32
35
  - job: tests
33
36
  trigger: pull_request
34
37
  targets:
35
38
  - fedora-all
36
- - centos-stream-9-x86_64
37
39
  - centos-stream-10-x86_64
38
40
 
39
41
  - job: propose_downstream
@@ -1,10 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-dbusmock
3
- Version: 0.35.0
3
+ Version: 0.36.0
4
4
  Summary: Mock D-Bus objects
5
- Home-page: https://github.com/martinpitt/python-dbusmock
6
- Download-URL: https://pypi.python.org/pypi/python-dbusmock/
7
- Author: Martin Pitt
8
5
  Author-email: Martin Pitt <martin@piware.de>
9
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
10
7
  Version 3, 29 June 2007
@@ -188,7 +185,6 @@ Requires-Python: >=3.8
188
185
  Description-Content-Type: text/markdown
189
186
  License-File: COPYING
190
187
  Requires-Dist: dbus-python
191
- Dynamic: download-url
192
188
  Dynamic: license-file
193
189
 
194
190
  ![CI status](https://github.com/martinpitt/python-dbusmock/actions/workflows/tests.yml/badge.svg)
@@ -5,8 +5,6 @@ NEWS
5
5
  README.md
6
6
  packit.yaml
7
7
  pyproject.toml
8
- setup.cfg
9
- setup.py
10
8
  .fmf/version
11
9
  .github/release.eloquent.yml
12
10
  .github/workflows/pages.yml
@@ -38,9 +36,9 @@ dbusmock/templates/timedated.py
38
36
  dbusmock/templates/upower.py
39
37
  dbusmock/templates/upower_power_profiles_daemon.py
40
38
  dbusmock/templates/urfkill.py
39
+ distro/python-dbusmock.spec
41
40
  doc/conf.py
42
41
  doc/index.rst
43
- packaging/python-dbusmock.spec
44
42
  plans/all.fmf
45
43
  python_dbusmock.egg-info/PKG-INFO
46
44
  python_dbusmock.egg-info/SOURCES.txt
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -6,7 +6,8 @@ dnf -y install python3-setuptools python3 python3-gobject-base \
6
6
  upower NetworkManager ModemManager bluez libnotify polkit
7
7
 
8
8
  if ! grep -q :el /etc/os-release; then
9
- dnf -y install power-profiles-daemon iio-sensor-proxy python3-pytest
9
+ # skip iio-sensor-proxy: https://github.com/martinpitt/python-dbusmock/issues/241
10
+ dnf -y install power-profiles-daemon python3-pytest
10
11
  else
11
12
  dnf -y install python3-pip
12
13
  pip install pytest
@@ -6,7 +6,8 @@ dnf -y install python3-setuptools python3 python3-gobject-base \
6
6
  upower NetworkManager ModemManager bluez libnotify polkit
7
7
 
8
8
  if ! grep -q :el /etc/os-release; then
9
- dnf -y install power-profiles-daemon iio-sensor-proxy python3-pytest
9
+ # skip iio-sensor-proxy: https://github.com/martinpitt/python-dbusmock/issues/241
10
+ dnf -y install power-profiles-daemon python3-pytest
10
11
  else
11
12
  dnf -y install python3-pip
12
13
  pip install pytest
@@ -343,6 +343,32 @@ assert args[2] == 5
343
343
  self.assertEqual(self.dbus_props.GetAll("org.freedesktop.Test.Other"), {"color": "yellow"})
344
344
  self.assertEqual(self.dbus_props.Get("org.freedesktop.Test.Other", "color"), "yellow")
345
345
 
346
+ # add properties with complex types
347
+ self.dbus_mock.AddProperty("org.freedesktop.Test.Main", "intarray", dbus.Array([1, 2]))
348
+ self.dbus_mock.AddProperty("org.freedesktop.Test.Main", "vardict", dbus.Dictionary({"a": 1}))
349
+ self.dbus_mock.AddProperty("org.freedesktop.Test.Main", "struct", dbus.Struct((1, "a")))
350
+
351
+ changes = [
352
+ {
353
+ "version": 5,
354
+ "connected": False,
355
+ },
356
+ {
357
+ "intarray": [1, 3],
358
+ },
359
+ {
360
+ "vardict": {"b": "2"},
361
+ },
362
+ {
363
+ "struct": (2, "b"),
364
+ },
365
+ {
366
+ "intarray": [3, 7],
367
+ "vardict": {"d": dbus.Array([42, 1])},
368
+ "struct": (0, "test"),
369
+ },
370
+ ]
371
+
346
372
  changed_props = []
347
373
  ml = GLib.MainLoop()
348
374
 
@@ -357,28 +383,26 @@ assert args[2] == 5
357
383
  self.assertEqual(iface, "org.freedesktop.Test.Main")
358
384
 
359
385
  changed_props.append(changed)
360
- ml.quit()
386
+
387
+ if len(changed_props) == len(changes):
388
+ ml.quit()
361
389
 
362
390
  match = self.dbus_con.add_signal_receiver(
363
391
  catch, interface_keyword="interface", path_keyword="path", member_keyword="member"
364
392
  )
365
393
 
366
394
  # change property using mock helper
367
- self.dbus_mock.UpdateProperties(
368
- "org.freedesktop.Test.Main",
369
- {
370
- "version": 5,
371
- "connected": False,
372
- },
373
- )
395
+ for change in changes:
396
+ self.dbus_mock.UpdateProperties("org.freedesktop.Test.Main", change)
397
+ self.assertTrue(change.items() <= self.dbus_props.GetAll("org.freedesktop.Test.Main").items())
374
398
 
375
399
  GLib.timeout_add(3000, ml.quit)
376
400
  ml.run()
377
401
 
378
402
  match.remove()
379
403
 
380
- self.assertEqual(self.dbus_props.GetAll("org.freedesktop.Test.Main"), {"version": 5, "connected": False})
381
- self.assertEqual(changed_props, [{"version": 5, "connected": False}])
404
+ for i, change in enumerate(changes):
405
+ self.assertEqual(changed_props[i], change)
382
406
 
383
407
  # test adding properties with the array type
384
408
  self.dbus_mock.AddProperty("org.freedesktop.Test.Main", "array", dbus.Array(["first"], signature="s"))
@@ -1 +0,0 @@
1
- __version__ = "0.35.0"
@@ -1,35 +0,0 @@
1
- [metadata]
2
- name = python-dbusmock
3
- version = attr: dbusmock.__version__
4
- description = Mock D-Bus objects
5
- long_description = file: README.md
6
- long_description_content_type = text/markdown
7
- author = Martin Pitt
8
- author_email = martin@piware.de
9
- url = https://github.com/martinpitt/python-dbusmock
10
- download_url = https://pypi.python.org/pypi/python-dbusmock/
11
- license = LGPL 3+
12
- classifiers =
13
- License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
14
- Programming Language :: Python :: 3
15
- Development Status :: 6 - Mature
16
- Operating System :: POSIX :: Linux
17
- Operating System :: POSIX :: BSD
18
- Operating System :: Unix
19
- Topic :: Software Development :: Quality Assurance
20
- Topic :: Software Development :: Testing
21
- Topic :: Software Development :: Testing :: Mocking
22
- Topic :: Software Development :: Testing :: Unit
23
- Topic :: Software Development :: Libraries :: Python Modules
24
-
25
- [options]
26
- packages =
27
- dbusmock
28
- dbusmock.templates
29
- install_requires =
30
- dbus-python
31
-
32
- [egg_info]
33
- tag_build =
34
- tag_date = 0
35
-
@@ -1,7 +0,0 @@
1
- #!/usr/bin/python3
2
- # this setup.py exists for the benefit of RPM builds. Doing that with PyPA build
3
- # is completely busted still.
4
-
5
- import setuptools
6
-
7
- setuptools.setup()
File without changes