lib: remove bt_query_executor_interrupt, add bt_query_executor_borrow_default_interrupter
[babeltrace.git] / tests / bindings / python / bt2 / test_query_executor.py
index 26e554615924d179a4ff96e4265a56470955acc1..a22f5d7db4df349a2d71cd66a33c9bb87f606ce5 100644 (file)
@@ -22,6 +22,15 @@ import re
 
 
 class QueryExecutorTestCase(unittest.TestCase):
+    def test_default_interrupter(self):
+        class MySink(bt2._UserSinkComponent):
+            def _user_consume(self):
+                pass
+
+        query_exec = bt2.QueryExecutor(MySink, 'obj')
+        interrupter = query_exec.default_interrupter
+        self.assertIs(type(interrupter), bt2.Interrupter)
+
     def test_query(self):
         class MySink(bt2._UserSinkComponent):
             def _user_consume(self):
@@ -262,7 +271,7 @@ class QueryExecutorTestCase(unittest.TestCase):
             @classmethod
             def _user_query(cls, priv_query_exec, obj, params, method_obj):
                 test_self.assertFalse(query_exec.is_interrupted)
-                query_exec.interrupt()
+                query_exec.default_interrupter.set()
                 test_self.assertTrue(query_exec.is_interrupted)
 
         test_self = self
@@ -288,3 +297,7 @@ class QueryExecutorTestCase(unittest.TestCase):
             test_priv_query_exec.logging_level
 
         del test_priv_query_exec
+
+
+if __name__ == '__main__':
+    unittest.main()
This page took 0.024275 seconds and 4 git commands to generate.