[gnome-bluetooth/wip/hadess/more-timeout-fixes] tests: Always start UPower mock
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/more-timeout-fixes] tests: Always start UPower mock
- Date: Wed, 23 Feb 2022 14:14:46 +0000 (UTC)
commit fdaafe61606037257124f864d5c0bb882a9a0a3e
Author: Bastien Nocera <hadess hadess net>
Date: Wed Feb 23 15:14:30 2022 +0100
tests: Always start UPower mock
tests/integration-test.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/tests/integration-test.py b/tests/integration-test.py
index 99d97def..7b0d233e 100755
--- a/tests/integration-test.py
+++ b/tests/integration-test.py
@@ -449,8 +449,10 @@ class Tests(dbusmock.DBusTestCase):
os.environ['G_DEBUG'] = 'fatal_warnings'
cls.start_system_bus()
cls.dbus_con = cls.get_dbus(True)
- (cls.p_mock, cls.obj_bluez) = cls.spawn_server_template(
+ (cls.p_mock_bluez, cls.obj_bluez) = cls.spawn_server_template(
'bluez5', {})
+ (cls.p_mock_upower, cls.obj_upower) = cls.spawn_server_template(
+ 'upower', {})
cls.exec_path = [sys.argv[0]]
cls.exec_dir = builddir + '/tests/'
@@ -459,8 +461,10 @@ class Tests(dbusmock.DBusTestCase):
@classmethod
def tearDownClass(cls):
- cls.p_mock.terminate()
- cls.p_mock.wait()
+ cls.p_mock_bluez.terminate()
+ cls.p_mock_bluez.wait()
+ cls.p_mock_upower.terminate()
+ cls.p_mock_upower.wait()
def setUp(self):
self.obj_bluez.Reset()
@@ -565,9 +569,7 @@ class Tests(dbusmock.DBusTestCase):
self.run_test_process()
def test_battery(self):
- (p_mock, obj_upower) = self.spawn_server_template(
- 'upower', {})
- mock = dbus.Interface(obj_upower, dbusmock.MOCK_IFACE)
+ mock = dbus.Interface(self.obj_upower, dbusmock.MOCK_IFACE)
self.dbusmock_bluez.AddAdapter('hci0', 'my-computer')
@@ -619,8 +621,6 @@ class Tests(dbusmock.DBusTestCase):
self.run_test_process()
- p_mock.terminate()
- p_mock.wait()
if __name__ == '__main__':
unittest.main()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]