[gnome-bluetooth/wip/hadess/fix-shell-menu: 1/4] tests: Wait longer than one loop iteration for device removal
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/fix-shell-menu: 1/4] tests: Wait longer than one loop iteration for device removal
- Date: Thu, 24 Feb 2022 11:13:52 +0000 (UTC)
commit 91aed3168ba5bc97881778539381313dda91b0db
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 24 11:10:43 2022 +0100
tests: Wait longer than one loop iteration for device removal
As we will defer device removal slightly.
tests/integration-test.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/tests/integration-test.py b/tests/integration-test.py
index 4c780fa5..2ca05e53 100755
--- a/tests/integration-test.py
+++ b/tests/integration-test.py
@@ -171,8 +171,7 @@ class OopTests(dbusmock.DBusTestCase):
address = f"{address_start:02d}:{address_start+1:02d}:{address_start+2:02d}:" + \
f"{address_start+3:02d}:{address_start+4:02d}:{address_start+5:02d}"
dbusmock_bluez.AddDevice('hci0', address, f'My Mouse {num_mice}')
- self.wait_for_mainloop()
- # self.wait_for_condition(lambda: list_store.get_n_items() == num_devices + to_add)
+ self.wait_for_condition(lambda: list_store.get_n_items() == num_devices + to_add, timeout=0.1)
self.assertEqual(list_store.get_n_items(), num_devices + to_add)
self.assertEqual(list_store.get_n_items(), num_devices_signal)
@@ -181,8 +180,7 @@ class OopTests(dbusmock.DBusTestCase):
device = list_store.get_item(i)
self.assertIsNotNone(device, f"Device at index {i} in list store did not exist")
hci0_bluez.RemoveDevice(device.get_object_path())
- self.wait_for_mainloop()
- # self.wait_for_condition(lambda: list_store.get_n_items() == total)
+ self.wait_for_condition(lambda: list_store.get_n_items() == total, timeout=0.1)
self.assertEqual(list_store.get_n_items(), total)
self.assertEqual(list_store.get_n_items(), num_devices_signal)
num_devices = total
@@ -193,8 +191,7 @@ class OopTests(dbusmock.DBusTestCase):
device = list_store.get_item(i)
hci0_bluez.RemoveDevice(device.get_object_path())
- self.wait_for_mainloop()
- # self.wait_for_condition(lambda: list_store.get_n_items() == 0)
+ self.wait_for_condition(lambda: list_store.get_n_items() == 0, timeout=0.1)
self.assertEqual(list_store.get_n_items(), 0)
self.assertEqual(num_devices_signal, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]