Hello community,
here is the log from the commit of package python-python-dbusmock for
openSUSE:Factory checked in at 2020-03-27 00:27:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-dbusmock (Old)
and /work/SRC/openSUSE:Factory/.python-python-dbusmock.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-dbusmock"
Fri Mar 27 00:27:59 2020 rev:5 rq:786924 version:0.19
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-dbusmock/python-python-dbusmock.changes
2020-02-06 13:19:12.584671783 +0100
+++
/work/SRC/openSUSE:Factory/.python-python-dbusmock.new.3160/python-python-dbusmock.changes
2020-03-27 00:28:01.332339618 +0100
@@ -1,0 +2,12 @@
+Fri Mar 20 13:02:15 UTC 2020 - [email protected]
+
+- version update to 0.19
+ - NetworkManager template: Add "StateReason" property and active connection
ID
+ - Add low-memory-monitor template
+
+-------------------------------------------------------------------
+Thu Mar 12 08:08:21 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Do not pull in py2 on python3 subpkg
+
+-------------------------------------------------------------------
Old:
----
python-dbusmock-0.18.3.tar.gz
New:
----
python-dbusmock-0.19.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-dbusmock.spec ++++++
--- /var/tmp/diff_new_pack.7hCbpL/_old 2020-03-27 00:28:02.016339964 +0100
+++ /var/tmp/diff_new_pack.7hCbpL/_new 2020-03-27 00:28:02.020339966 +0100
@@ -18,20 +18,19 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-dbusmock
-Version: 0.18.3
+Version: 0.19
Release: 0
Summary: Python library for creating mock D-Bus objects
License: LGPL-3.0-or-later
URL: https://github.com/martinpitt/python-dbusmock
Source:
https://files.pythonhosted.org/packages/source/p/python-dbusmock/python-dbusmock-%{version}.tar.gz
BuildRequires: %{python_module dbus-python}
-BuildRequires: %{python_module nose}
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(gobject-introspection-1.0)
-Requires: dbus-1-python
Requires: dbus-1-x11
Requires: python-dbus-python
Requires: python-gobject
@@ -57,7 +56,7 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib}
nosetests-%{$python_bin_suffix} -v
+%pytest
%files %{python_files}
%license COPYING
++++++ python-dbusmock-0.18.3.tar.gz -> python-dbusmock-0.19.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-dbusmock-0.18.3/NEWS
new/python-dbusmock-0.19/NEWS
--- old/python-dbusmock-0.18.3/NEWS 2019-09-08 22:58:52.000000000 +0200
+++ new/python-dbusmock-0.19/NEWS 2020-01-09 21:21:27.000000000 +0100
@@ -1,3 +1,8 @@
+0.19 (2020-01-09)
+-----------------
+- NetworkManager template: Add "StateReason" property and active connection ID
+- Add low-memory-monitor template
+
0.18.3 (2019-09-08)
-------------------
- Fix timeouts for loaded machines and parallel tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-dbusmock-0.18.3/PKG-INFO
new/python-dbusmock-0.19/PKG-INFO
--- old/python-dbusmock-0.18.3/PKG-INFO 2019-09-08 23:00:09.000000000 +0200
+++ new/python-dbusmock-0.19/PKG-INFO 2020-01-09 21:22:37.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-dbusmock
-Version: 0.18.3
+Version: 0.19
Summary: Mock D-Bus objects
Home-page: https://github.com/martinpitt/python-dbusmock
Author: Martin Pitt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-dbusmock-0.18.3/dbusmock/templates/low_memory_monitor.py
new/python-dbusmock-0.19/dbusmock/templates/low_memory_monitor.py
--- old/python-dbusmock-0.18.3/dbusmock/templates/low_memory_monitor.py
1970-01-01 01:00:00.000000000 +0100
+++ new/python-dbusmock-0.19/dbusmock/templates/low_memory_monitor.py
2020-01-09 21:21:27.000000000 +0100
@@ -0,0 +1,38 @@
+'''low-memory-monitor mock template
+
+This creates the expected methods and properties of the main
+org.freedesktop.LowMemoryMonitor object.
+
+This provides only the 2.0 D-Bus API of low-memory-monitor.
+'''
+
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option) any
+# later version. See http://www.gnu.org/copyleft/lgpl.html for the full text
+# of the license.
+
+__author__ = 'Bastien Nocera'
+__email__ = '[email protected]'
+__copyright__ = '(c) 2019, Red Hat Inc.'
+__license__ = 'LGPL 3+'
+
+import dbus
+
+from dbusmock import MOCK_IFACE
+
+BUS_NAME = 'org.freedesktop.LowMemoryMonitor'
+MAIN_OBJ = '/org/freedesktop/LowMemoryMonitor'
+MAIN_IFACE = 'org.freedesktop.LowMemoryMonitor'
+SYSTEM_BUS = True
+
+
+def load(mock, parameters):
+ # Loaded!
+ mock.loaded = True
+
+
[email protected](MOCK_IFACE,
+ in_signature='y', out_signature='')
+def EmitWarning(self, state):
+ self.EmitSignal(MAIN_IFACE, 'LowMemoryWarning', 'y', [dbus.Byte(state)])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-dbusmock-0.18.3/dbusmock/templates/networkmanager.py
new/python-dbusmock-0.19/dbusmock/templates/networkmanager.py
--- old/python-dbusmock-0.18.3/dbusmock/templates/networkmanager.py
2019-09-08 22:58:52.000000000 +0200
+++ new/python-dbusmock-0.19/dbusmock/templates/networkmanager.py
2020-01-09 21:21:27.000000000 +0100
@@ -43,7 +43,7 @@
class NMState:
'''Global state
- As per
https://developer.gnome.org/NetworkManager/unstable/spec.html#type-NM_STATE
+ As per
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMState
'''
NM_STATE_UNKNOWN = 0
NM_STATE_ASLEEP = 10
@@ -58,7 +58,7 @@
class NMConnectivityState:
'''Connectvity state
- As per
https://developer.gnome.org/NetworkManager/unstable/spec.html#type-NM_CONNECTIVITY
+ As per
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMConnectivityState
'''
NM_CONNECTIVITY_UNKNOWN = 0
NM_CONNECTIVITY_NONE = 1
@@ -70,7 +70,7 @@
class NMActiveConnectionState:
'''Active connection state
- As per
https://developer.gnome.org/NetworkManager/unstable/spec.html#type-NM_ACTIVE_CONNECTION_STATE
+ As per
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMActiveConnectionState
'''
NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0
NM_ACTIVE_CONNECTION_STATE_ACTIVATING = 1
@@ -82,7 +82,7 @@
class InfrastructureMode:
'''Infrastructure mode
- As per
https://developer.gnome.org/NetworkManager/unstable/spec.html#type-NM_802_11_MODE
+ As per
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NM80211Mode
'''
NM_802_11_MODE_UNKNOWN = 0
NM_802_11_MODE_ADHOC = 1
@@ -100,7 +100,7 @@
class DeviceState:
'''Device states
- As per
https://developer.gnome.org/NetworkManager/unstable/spec.html#type-NM_DEVICE_STATE
+ As per
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMDeviceState
'''
UNKNOWN = 0
UNMANAGED = 10
@@ -120,7 +120,7 @@
class NM80211ApSecurityFlags:
'''Security flags
- As per
https://developer.gnome.org/NetworkManager/unstable/spec.html#type-NM_802_11_AP_SEC
+ As per
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NM80211ApSecurityFlags
'''
NM_802_11_AP_SEC_NONE = 0x00000000
NM_802_11_AP_SEC_PAIR_WEP40 = 0x00000001
@@ -145,7 +145,7 @@
class NM80211ApFlags:
'''Device flags
- As per
https://developer.gnome.org/NetworkManager/unstable/spec.html#type-NM_802_11_AP_FLAGS
+ As per
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NM80211ApFlags
'''
NM_802_11_AP_FLAGS_NONE = 0x00000000
NM_802_11_AP_FLAGS_PRIVACY = 0x00000001
@@ -279,6 +279,7 @@
dev_obj.Set(DEVICE_IFACE, 'ActiveConnection',
dbus.ObjectPath(active_connection_path))
old_state = dev_obj.Get(DEVICE_IFACE, 'State')
dev_obj.Set(DEVICE_IFACE, 'State', dbus.UInt32(DeviceState.ACTIVATED))
+ dev_obj.Set(DEVICE_IFACE, 'StateReason',
(dbus.UInt32(DeviceState.ACTIVATED), dbus.UInt32(0)))
dev_obj.EmitSignal(DEVICE_IFACE, 'StateChanged', 'uuu',
[dbus.UInt32(DeviceState.ACTIVATED), old_state, dbus.UInt32(1)])
@@ -290,6 +291,7 @@
dev_obj.Set(DEVICE_IFACE, 'ActiveConnection', dbus.ObjectPath('/'))
old_state = dev_obj.Get(DEVICE_IFACE, 'State')
dev_obj.Set(DEVICE_IFACE, 'State', dbus.UInt32(DeviceState.DISCONNECTED))
+ dev_obj.Set(DEVICE_IFACE, 'StateReason',
(dbus.UInt32(DeviceState.DISCONNECTED), dbus.UInt32(0)))
dev_obj.EmitSignal(DEVICE_IFACE, 'StateChanged', 'uuu',
[dbus.UInt32(DeviceState.DISCONNECTED), old_state, dbus.UInt32(1)])
@@ -303,7 +305,7 @@
state. You can use the predefined DeviceState values (e. g.
DeviceState.ACTIVATED) or supply a numeric value. For valid state values
please visit
-
http://projects.gnome.org/NetworkManager/developers/api/09/spec.html#type-NM_DEVICE_STATE
+
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMDeviceState
Please note that this does not set any global properties.
@@ -321,6 +323,7 @@
props = {'DeviceType': dbus.UInt32(1),
'State': dbus.UInt32(state),
+ 'StateReason': (dbus.UInt32(state), dbus.UInt32(0)),
'Interface': iface_name,
'ActiveConnection': dbus.ObjectPath('/'),
'AvailableConnections': dbus.Array([], signature='o'),
@@ -352,7 +355,7 @@
state. You can use the predefined DeviceState values (e. g.
DeviceState.ACTIVATED) or supply a numeric value. For valid state values,
please visit
-
http://projects.gnome.org/NetworkManager/developers/api/09/spec.html#type-NM_DEVICE_STATE
+
https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMDeviceState
Please note that this does not set any global properties.
@@ -389,6 +392,7 @@
'Driver': 'dbusmock',
'DeviceType': dbus.UInt32(2),
'State': dbus.UInt32(state),
+ 'StateReason': (dbus.UInt32(state),
dbus.UInt32(0)),
'Interface': iface_name,
'IpInterface': iface_name,
})
@@ -413,7 +417,7 @@
You have to specify WiFi Device path, Access Point object name,
ssid, hw_address, mode, frequency, rate, strength and security.
For valid access point property values, please visit
-
http://projects.gnome.org/NetworkManager/developers/api/09/spec.html#org.freedesktop.NetworkManager.AccessPoint
+
https://developer.gnome.org/NetworkManager/unstable/gdbus-org.freedesktop.NetworkManager.AccessPoint.html
Please note that this does not set any global properties.
@@ -575,6 +579,7 @@
settings = conn_obj.settings
conn_uuid = settings['connection']['uuid']
conn_type = settings['connection']['type']
+ conn_id = settings['connection']['id']
device_objects = [dbus.ObjectPath(dev) for dev in devices]
@@ -592,6 +597,7 @@
'SpecificObject': dbus.ObjectPath(specific_object),
'Uuid': conn_uuid,
'State': dbus.UInt32(state),
+ 'Id': conn_id,
},
[])
@@ -699,8 +705,7 @@
'''Add a connection.
connection_settings is a String String Variant Map Map. See
- https://developer.gnome.org/NetworkManager/0.9/spec.html
- #type-String_String_Variant_Map_Map
+ https://developer.gnome.org/NetworkManager/0.9/spec.html
#type-String_String_Variant_Map_Map
If you omit uuid, this method adds one for you.
'''
@@ -780,8 +785,7 @@
'''Update settings on a connection.
settings is a String String Variant Map Map. See
- https://developer.gnome.org/NetworkManager/0.9/spec.html
- #type-String_String_Variant_Map_Map
+
https://developer.gnome.org/NetworkManager/0.9/spec.html#type-String_String_Variant_Map_Map
'''
connection_path = self.connection_path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-dbusmock-0.18.3/python_dbusmock.egg-info/PKG-INFO
new/python-dbusmock-0.19/python_dbusmock.egg-info/PKG-INFO
--- old/python-dbusmock-0.18.3/python_dbusmock.egg-info/PKG-INFO
2019-09-08 23:00:09.000000000 +0200
+++ new/python-dbusmock-0.19/python_dbusmock.egg-info/PKG-INFO 2020-01-09
21:22:37.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-dbusmock
-Version: 0.18.3
+Version: 0.19
Summary: Mock D-Bus objects
Home-page: https://github.com/martinpitt/python-dbusmock
Author: Martin Pitt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-dbusmock-0.18.3/python_dbusmock.egg-info/SOURCES.txt
new/python-dbusmock-0.19/python_dbusmock.egg-info/SOURCES.txt
--- old/python-dbusmock-0.18.3/python_dbusmock.egg-info/SOURCES.txt
2019-09-08 23:00:09.000000000 +0200
+++ new/python-dbusmock-0.19/python_dbusmock.egg-info/SOURCES.txt
2020-01-09 21:22:37.000000000 +0100
@@ -13,6 +13,7 @@
dbusmock/templates/bluez5.py
dbusmock/templates/gnome_screensaver.py
dbusmock/templates/logind.py
+dbusmock/templates/low_memory_monitor.py
dbusmock/templates/networkmanager.py
dbusmock/templates/notification_daemon.py
dbusmock/templates/ofono.py
@@ -32,6 +33,7 @@
tests/test_consolekit.py
tests/test_gnome_screensaver.py
tests/test_logind.py
+tests/test_low_memory_monitor.py
tests/test_networkmanager.py
tests/test_notification_daemon.py
tests/test_ofono.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-dbusmock-0.18.3/tests/test_low_memory_monitor.py
new/python-dbusmock-0.19/tests/test_low_memory_monitor.py
--- old/python-dbusmock-0.18.3/tests/test_low_memory_monitor.py 1970-01-01
01:00:00.000000000 +0100
+++ new/python-dbusmock-0.19/tests/test_low_memory_monitor.py 2020-01-09
21:21:27.000000000 +0100
@@ -0,0 +1,61 @@
+#!/usr/bin/python3
+
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option) any
+# later version. See http://www.gnu.org/copyleft/lgpl.html for the full text
+# of the license.
+
+__author__ = 'Bastien Nocera'
+__email__ = '[email protected]'
+__copyright__ = '(c) 2019 Red Hat Inc.'
+__license__ = 'LGPL 3+'
+
+import unittest
+import sys
+import subprocess
+import dbus
+import dbus.mainloop.glib
+import dbusmock
+import fcntl
+import os
+
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+
+class TestLowMemoryMonitor(dbusmock.DBusTestCase):
+ '''Test mocking low-memory-monitor'''
+
+ @classmethod
+ def setUpClass(klass):
+ klass.start_system_bus()
+ klass.dbus_con = klass.get_dbus(True)
+
+ def setUp(self):
+ (self.p_mock, self.obj_lmm) = self.spawn_server_template(
+ 'low_memory_monitor', {}, stdout=subprocess.PIPE)
+ # set log to nonblocking
+ flags = fcntl.fcntl(self.p_mock.stdout, fcntl.F_GETFL)
+ fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
+ self.last_warning = -1
+ self.dbusmock = dbus.Interface(self.obj_lmm, dbusmock.MOCK_IFACE)
+
+ def tearDown(self):
+ self.p_mock.terminate()
+ self.p_mock.wait()
+
+ def test_low_memory_warning_signal(self):
+ '''LowMemoryWarning signal'''
+
+ self.dbusmock.EmitWarning(100)
+ log = self.p_mock.stdout.read()
+ self.assertRegex(log, b'[0-9.]+ emit .*LowMemoryWarning 100\n')
+
+ self.dbusmock.EmitWarning(255)
+ log = self.p_mock.stdout.read()
+ self.assertRegex(log, b'[0-9.]+ emit .*LowMemoryWarning 255\n')
+
+
+if __name__ == '__main__':
+ # avoid writing to stderr
+ unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout,
verbosity=2))