[gnome-bluetooth/wip/hadess/function-removal: 4/9] tests: Use new num-adapters property
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/function-removal: 4/9] tests: Use new num-adapters property
- Date: Thu, 18 Nov 2021 17:01:40 +0000 (UTC)
commit 8dbb91e6fc208e8d5349e57d022c7ee6afee5240
Author: Bastien Nocera <hadess hadess net>
Date: Thu Nov 18 15:49:42 2021 +0100
tests: Use new num-adapters property
tests/integration-test | 27 +++++----------------------
1 file changed, 5 insertions(+), 22 deletions(-)
---
diff --git a/tests/integration-test b/tests/integration-test
index f73621c2..8833e88a 100755
--- a/tests/integration-test
+++ b/tests/integration-test
@@ -77,21 +77,12 @@ class OopTests(dbusmock.DBusTestCase):
ctx.iteration(True)
def test_no_adapters(self):
- adapters = self.client.get_adapter_model()
self.wait_for_mainloop()
- self.assertEqual(len(adapters), 0)
+ self.assertEqual(self.client.get_property('num-adapters'), 0)
def test_one_adapter(self):
- adapters = self.client.get_adapter_model()
- self._row_inserted = False
-
- def adapters_row_inserted_cb(model, path, _iter):
- self._row_inserted = True
- adapters.connect('row-inserted', adapters_row_inserted_cb)
-
- self.wait_for_condition(lambda: self._row_inserted == True)
-
- self.assertEqual(len(adapters), 1)
+ self.wait_for_condition(lambda: self.client.get_property('num-adapters') != 0)
+ self.assertEqual(self.client.get_property('num-adapters'), 1)
def _pair_cb(self, client, result, user_data=None):
success, path = client.setup_device_finish(result)
@@ -101,16 +92,8 @@ class OopTests(dbusmock.DBusTestCase):
self.paired = True
def test_pairing(self):
- adapters = self.client.get_adapter_model()
- self._row_inserted = False
-
- def adapters_row_inserted_cb(model, path, _iter):
- self._row_inserted = True
- adapters.connect('row-inserted', adapters_row_inserted_cb)
-
- self.wait_for_condition(lambda: self._row_inserted == True)
-
- self.assertEqual(len(adapters), 1)
+ self.wait_for_condition(lambda: self.client.get_property('num-adapters') != 0)
+ self.assertEqual(self.client.get_property('num-adapters'), 1)
devices = self.client.get_device_model()
self.assertEqual(len(devices), 1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]