python-dbusmock 0.30.1__tar.gz → 0.31.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 (73) hide show
  1. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/.github/workflows/pages.yml +1 -1
  2. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/.github/workflows/release.yml +9 -7
  3. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/.github/workflows/tests.yml +1 -1
  4. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/PKG-INFO +1 -1
  5. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/_version.py +1 -1
  6. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/bluez5.py +1 -1
  7. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/logind.py +2 -2
  8. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/networkmanager.py +8 -2
  9. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/power_profiles_daemon.py +4 -4
  10. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/pyproject.toml +1 -0
  11. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/python_dbusmock.egg-info/PKG-INFO +1 -1
  12. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/run-debian +6 -0
  13. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/run-ubuntu +6 -0
  14. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_networkmanager.py +10 -3
  15. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/.fmf/version +0 -0
  16. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/.github/release.eloquent.yml +0 -0
  17. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/.gitignore +0 -0
  18. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/.pre-commit-config.yaml +0 -0
  19. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/COPYING +0 -0
  20. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/NEWS +0 -0
  21. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/README.md +0 -0
  22. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/__init__.py +2 -2
  23. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/__main__.py +0 -0
  24. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/mockobject.py +0 -0
  25. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/pytest_fixtures.py +0 -0
  26. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/SKELETON +0 -0
  27. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/__init__.py +0 -0
  28. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/bluez5-obex.py +0 -0
  29. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/gnome_screensaver.py +0 -0
  30. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/iio-sensors-proxy.py +0 -0
  31. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/low_memory_monitor.py +0 -0
  32. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/notification_daemon.py +0 -0
  33. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/ofono.py +0 -0
  34. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/polkitd.py +0 -0
  35. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/systemd.py +0 -0
  36. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/timedated.py +0 -0
  37. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/upower.py +0 -0
  38. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/templates/urfkill.py +0 -0
  39. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/dbusmock/testcase.py +0 -0
  40. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/doc/conf.py +0 -0
  41. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/doc/index.rst +0 -0
  42. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/packaging/python-dbusmock.spec +0 -0
  43. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/packit.yaml +0 -0
  44. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/plans/all.fmf +0 -0
  45. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/python_dbusmock.egg-info/SOURCES.txt +0 -0
  46. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/python_dbusmock.egg-info/dependency_links.txt +0 -0
  47. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/python_dbusmock.egg-info/requires.txt +0 -0
  48. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/python_dbusmock.egg-info/top_level.txt +0 -0
  49. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/setup.cfg +0 -0
  50. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/setup.py +0 -0
  51. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/__init__.py +0 -0
  52. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/conftest.py +0 -0
  53. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/main.fmf +0 -0
  54. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/run +0 -0
  55. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/run-centos +0 -0
  56. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/run-fedora +0 -0
  57. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_api.py +0 -0
  58. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_api_pytest.py +0 -0
  59. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_bluez5.py +0 -0
  60. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_cli.py +0 -0
  61. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_code.py +0 -0
  62. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_gnome_screensaver.py +0 -0
  63. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_iio_sensors_proxy.py +0 -0
  64. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_logind.py +0 -0
  65. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_low_memory_monitor.py +0 -0
  66. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_notification_daemon.py +0 -0
  67. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_ofono.py +0 -0
  68. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_polkitd.py +0 -0
  69. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_power_profiles_daemon.py +0 -0
  70. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_systemd.py +0 -0
  71. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_timedated.py +0 -0
  72. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_upower.py +0 -0
  73. {python-dbusmock-0.30.1 → python-dbusmock-0.31.0}/tests/test_urfkill.py +0 -0
@@ -25,7 +25,7 @@ jobs:
25
25
  url: ${{ steps.deployment.outputs.page_url }}
26
26
 
27
27
  steps:
28
- - uses: actions/checkout@v3
28
+ - uses: actions/checkout@v4
29
29
 
30
30
  - name: Set up Python
31
31
  uses: actions/setup-python@v4
@@ -7,16 +7,21 @@ on:
7
7
  jobs:
8
8
  release:
9
9
  runs-on: ubuntu-22.04
10
+ environment: release
11
+ permissions:
12
+ # PyPI trusted publisher
13
+ id-token: write
14
+ # create release
15
+ contents: write
10
16
  steps:
11
17
  - name: Clone repository
12
- uses: actions/checkout@v3
18
+ uses: actions/checkout@v4
13
19
  with:
14
20
  # need this to also fetch tags
15
21
  fetch-depth: 0
16
22
 
17
- # https://github.blog/2022-04-12-git-security-vulnerability-announced/
18
- - name: Pacify git's permission check
19
- run: git config --global --add safe.directory /__w
23
+ - name: Workaround for https://github.com/actions/checkout/pull/697
24
+ run: git fetch --force origin $(git describe --tags):refs/tags/$(git describe --tags)
20
25
 
21
26
  - name: Install dependencies
22
27
  run: |
@@ -46,6 +51,3 @@ jobs:
46
51
 
47
52
  - name: Create PyPy release
48
53
  uses: pypa/gh-action-pypi-publish@release/v1
49
- with:
50
- user: __token__
51
- password: ${{ secrets.PYPI_API_TOKEN }}
@@ -23,7 +23,7 @@ jobs:
23
23
  timeout-minutes: 30
24
24
  steps:
25
25
  - name: Clone repository
26
- uses: actions/checkout@v3
26
+ uses: actions/checkout@v4
27
27
  with:
28
28
  # need this to also fetch tags
29
29
  fetch-depth: 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-dbusmock
3
- Version: 0.30.1
3
+ Version: 0.31.0
4
4
  Summary: Mock D-Bus objects
5
5
  Home-page: https://github.com/martinpitt/python-dbusmock
6
6
  Author: Martin Pitt
@@ -1,2 +1,2 @@
1
1
  '''auto-generated version from setuptools_scm'''
2
- __version__ = "0.30.1"
2
+ __version__ = "0.31.0"
@@ -333,7 +333,7 @@ def Pair(device):
333
333
  raise dbus.exceptions.DBusException("Device already paired", name="org.bluez.Error.AlreadyExists")
334
334
  device_address = device.props[DEVICE_IFACE]["Address"]
335
335
  adapter_device_name = Path(device.props[DEVICE_IFACE]["Adapter"]).name
336
- device.PairDevice(adapter_device_name, device_address, MOCK_PHONE_CLASS)
336
+ device.PairDevice(adapter_device_name, device_address)
337
337
 
338
338
 
339
339
  @dbus.service.method(DEVICE_IFACE, in_signature="", out_signature="")
@@ -201,7 +201,7 @@ def AddUser(self, uid, username, active):
201
201
  "Service": "",
202
202
  "Sessions": dbus.Array([], signature="(so)"),
203
203
  "Slice": f"user-{uid}.slice",
204
- "State": (active and "active" or "online"),
204
+ "State": "active" if active else "online",
205
205
  "Timestamp": dbus.UInt64(42),
206
206
  "TimestampMonotonic": dbus.UInt64(42),
207
207
  "UID": dbus.UInt32(uid),
@@ -256,7 +256,7 @@ def AddSession(self, session_id, seat, uid, username, active):
256
256
  "RemoteHost": "",
257
257
  "RemoteUser": "",
258
258
  "Service": "dbusmock",
259
- "State": (active and "active" or "online"),
259
+ "State": "active" if active else "online",
260
260
  "TTY": "",
261
261
  "Type": "test",
262
262
  "Seat": (seat, seat_path),
@@ -503,7 +503,7 @@ def AddWiFiConnection(self, dev_path, connection_name, ssid_name, _key_mgmt):
503
503
 
504
504
  The SSID must match one of the previously created access points.
505
505
 
506
- Please note that this does not set any global properties.
506
+ Please note that this only sets minimal global properties in ipv{4,6}, no others.
507
507
 
508
508
  Returns the new object path.
509
509
  """
@@ -558,6 +558,12 @@ def AddWiFiConnection(self, dev_path, connection_name, ssid_name, _key_mgmt):
558
558
  "id": ssid_name,
559
559
  "uuid": str(uuid.uuid4()),
560
560
  },
561
+ "ipv4": {
562
+ "method": "auto",
563
+ },
564
+ "ipv6": {
565
+ "method": "auto",
566
+ },
561
567
  }
562
568
 
563
569
  if security != NM80211ApSecurityFlags.NM_802_11_AP_SEC_NONE:
@@ -810,7 +816,7 @@ def SettingsGetConnectionByUuid(self, conn_uuid):
810
816
  settings = self.conn.GetSettings()
811
817
  if settings["connection"]["uuid"] == conn_uuid:
812
818
  return o
813
- raise dbus.exceptions.DBusException(f"There was no connection with uuid {conn_uuid}")
819
+ raise dbus.exceptions.DBusException("No connection with the UUID was found.")
814
820
 
815
821
 
816
822
  def ConnectionUpdate(self, settings):
@@ -15,14 +15,14 @@ This provides only the non-deprecated D-Bus API as of version 0.9.
15
15
  __author__ = "Bastien Nocera"
16
16
  __copyright__ = """
17
17
  (c) 2021, Red Hat Inc.
18
- (c) 2017 - 2022 Martin Pitt <martin@piware.de>
18
+ (c) 2017 - 2024 Martin Pitt <martin@piware.de>
19
19
  """
20
20
 
21
21
  import dbus
22
22
 
23
- BUS_NAME = "net.hadess.PowerProfiles"
24
- MAIN_OBJ = "/net/hadess/PowerProfiles"
25
- MAIN_IFACE = "net.hadess.PowerProfiles"
23
+ BUS_NAME = "org.freedesktop.UPower.PowerProfiles"
24
+ MAIN_OBJ = "/org/freedesktop/UPower/PowerProfiles"
25
+ MAIN_IFACE = "org.freedesktop.UPower.PowerProfiles"
26
26
  SYSTEM_BUS = True
27
27
 
28
28
 
@@ -57,6 +57,7 @@ ignore_missing_imports = true
57
57
  line-length = 130
58
58
  preview = true
59
59
 
60
+ [tool.ruff.lint]
60
61
  select = [
61
62
  "A", # flake8-builtins
62
63
  "B", # flake8-bugbear
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-dbusmock
3
- Version: 0.30.1
3
+ Version: 0.31.0
4
4
  Summary: Mock D-Bus objects
5
5
  Home-page: https://github.com/martinpitt/python-dbusmock
6
6
  Author: Martin Pitt
@@ -16,6 +16,12 @@ eatmydata apt-get install --no-install-recommends -y git \
16
16
  python3-dbus python3-pytest python3-gi gir1.2-glib-2.0 \
17
17
  dbus libnotify-bin upower network-manager bluez ofono ofono-scripts
18
18
 
19
+ # power-profiles-daemon 0.20 did not yet land in Ubuntu 24.04
20
+ . /etc/os-release
21
+ if [ "$ID" = "debian" ]; then
22
+ eatmydata apt-get install -y power-profiles-daemon
23
+ fi
24
+
19
25
  # systemd's tools otherwise fail on "not been booted with systemd"
20
26
  mkdir -p /run/systemd/system
21
27
 
@@ -16,6 +16,12 @@ eatmydata apt-get install --no-install-recommends -y git \
16
16
  python3-dbus python3-pytest python3-gi gir1.2-glib-2.0 \
17
17
  dbus libnotify-bin upower network-manager bluez ofono ofono-scripts
18
18
 
19
+ # power-profiles-daemon 0.20 did not yet land in Ubuntu 24.04
20
+ . /etc/os-release
21
+ if [ "$ID" = "debian" ]; then
22
+ eatmydata apt-get install -y power-profiles-daemon
23
+ fi
24
+
19
25
  # systemd's tools otherwise fail on "not been booted with systemd"
20
26
  mkdir -p /run/systemd/system
21
27
 
@@ -242,6 +242,14 @@ class TestNetworkManager(dbusmock.DBusTestCase):
242
242
  self.assertEqual(ap1, "/org/freedesktop/NetworkManager/AccessPoint/Mock_AP1")
243
243
  self.assertEqual(con1, "/org/freedesktop/NetworkManager/Settings/Mock_Con1")
244
244
 
245
+ settings = subprocess.check_output(
246
+ ["nmcli", "--nocheck", "connection", "show", "The_SSID"], env=self.lang_env, universal_newlines=True
247
+ )
248
+ self.assertRegex(settings, r"ipv4.method:\s*auto")
249
+ self.assertRegex(settings, r"ipv4.gateway:\s*--")
250
+ self.assertRegex(settings, r"ipv6.method:\s*auto")
251
+ self.assertRegex(settings, r"ipv4.gateway:\s*--")
252
+
245
253
  def test_global_state(self):
246
254
  self.dbusmock.SetGlobalConnectionState(NMState.NM_STATE_CONNECTED_GLOBAL)
247
255
  self.assertRegex(self.read_general(), r"connected.*\sfull")
@@ -585,9 +593,8 @@ class TestNetworkManager(dbusmock.DBusTestCase):
585
593
  connectionPath = self.settings.AddConnection(settings)
586
594
  self.assertEqual(self.settings.GetConnectionByUuid(uuid), connectionPath)
587
595
 
588
- fakeuuid = "123123123213213"
589
- with self.assertRaisesRegex(dbus.exceptions.DBusException, f".*uuid.*{fakeuuid}$"):
590
- self.settings.GetConnectionByUuid(fakeuuid)
596
+ with self.assertRaisesRegex(dbus.exceptions.DBusException, "No connection with the UUID was found."):
597
+ self.settings.GetConnectionByUuid("123123123213213")
591
598
 
592
599
 
593
600
  if __name__ == "__main__":
File without changes
@@ -25,12 +25,12 @@ except ImportError:
25
25
 
26
26
 
27
27
  __all__ = [
28
- "DBusMockObject",
29
28
  "MOCK_IFACE",
30
29
  "OBJECT_MANAGER_IFACE",
30
+ "BusType",
31
+ "DBusMockObject",
31
32
  "DBusTestCase",
32
33
  "PrivateDBus",
33
- "BusType",
34
34
  "SpawnedMock",
35
35
  "get_object",
36
36
  "get_objects",