[gnome-bluetooth/wip/hadess/bluetooth-off-turn-off] tests: Add test for missing row-changed signal
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/bluetooth-off-turn-off] tests: Add test for missing row-changed signal
- Date: Fri, 10 Dec 2021 18:13:24 +0000 (UTC)
commit 34b19876ca695351750ba9703aa962ed6c99c61e
Author: Bastien Nocera <hadess hadess net>
Date: Fri Dec 10 14:25:33 2021 +0100
tests: Add test for missing row-changed signal
tests/integration-test | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
---
diff --git a/tests/integration-test b/tests/integration-test
index 72b4b8d0..edf42585 100755
--- a/tests/integration-test
+++ b/tests/integration-test
@@ -60,6 +60,8 @@ class OopTests(dbusmock.DBusTestCase):
self.client = GnomeBluetoothPriv.Client.new()
# used in test_pairing
self.paired = False
+ # used in test_default_notify
+ self.default_adapter = None
def print_tree(self, model):
def print_row(model, treepath, treeiter):
@@ -141,6 +143,29 @@ class OopTests(dbusmock.DBusTestCase):
self.assertTrue(agent.register())
self.assertTrue(agent.unregister())
+ def test_default_notify(self):
+ model = self.client.get_model()
+
+ def _sync(self, model):
+ for adapter in model:
+ default = adapter[GnomeBluetoothPriv.Column.DEFAULT]
+ powered = adapter[GnomeBluetoothPriv.Column.POWERED]
+ if default and powered:
+ self.default_adapter = adapter[GnomeBluetoothPriv.Column.ADDRESS]
+ break
+ def row_inserted_cb(model, path, _iter):
+ _sync(self, model)
+ def row_deleted_cb(model, path):
+ _sync(self, model)
+ def row_changed_cb(model, path, _iter):
+ _sync(self, model)
+ model.connect('row-inserted', row_inserted_cb)
+ model.connect('row-deleted', row_deleted_cb)
+ model.connect('row-changed', row_changed_cb)
+
+ self.wait_for_mainloop()
+ self.assertEqual(self.default_adapter, '00:11:22:33:44:55')
+
class Tests(dbusmock.DBusTestCase):
@classmethod
@@ -198,5 +223,8 @@ class Tests(dbusmock.DBusTestCase):
def test_agent(self):
self.run_test_process()
+ def test_default_notify(self):
+ self.run_test_process()
+
if __name__ == '__main__':
unittest.main()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]