autodisc: don't accept NULL values for `support-info` query `group` key
[babeltrace.git] / tests / bindings / python / bt2 / test_error.py
index 9ae8b36c08090e51be8cde73893cc84d13ad5df8..11328db7b1814e427dd56b3123028e4baa866866 100644 (file)
@@ -29,36 +29,36 @@ class FailingIter(bt2._UserMessageIterator):
 class SourceWithFailingIter(
     bt2._UserSourceComponent, message_iterator_class=FailingIter
 ):
-    def __init__(self, params):
+    def __init__(self, params, obj):
         self._add_output_port('out')
 
 
 class SourceWithFailingInit(
     bt2._UserSourceComponent, message_iterator_class=FailingIter
 ):
-    def __init__(self, params):
+    def __init__(self, params, obj):
         raise ValueError('Source is failing')
 
 
 class WorkingSink(bt2._UserSinkComponent):
-    def __init__(self, params):
+    def __init__(self, params, obj):
         self._in = self._add_input_port('in')
 
-    def _graph_is_configured(self):
+    def _user_graph_is_configured(self):
         self._iter = self._create_input_port_message_iterator(self._in)
 
-    def _consume(self):
+    def _user_consume(self):
         next(self._iter)
 
 
 class SinkWithExceptionChaining(bt2._UserSinkComponent):
-    def __init__(self, params):
+    def __init__(self, params, obj):
         self._in = self._add_input_port('in')
 
-    def _graph_is_configured(self):
+    def _user_graph_is_configured(self):
         self._iter = self._create_input_port_message_iterator(self._in)
 
-    def _consume(self):
+    def _user_consume(self):
         try:
             next(self._iter)
         except bt2._Error as e:
@@ -66,14 +66,11 @@ class SinkWithExceptionChaining(bt2._UserSinkComponent):
 
 
 class SinkWithFailingQuery(bt2._UserSinkComponent):
-    def _graph_is_configured(self):
-        pass
-
-    def _consume(self):
+    def _user_consume(self):
         pass
 
     @staticmethod
-    def _query(executor, obj, params, log_level):
+    def _user_query(priv_executor, obj, params, method_obj):
         raise ValueError('Query is failing')
 
 
@@ -180,10 +177,10 @@ class ErrorTestCase(unittest.TestCase):
         self.assertIsNone(cause.plugin_name)
 
     def test_component_class_error_cause(self):
-        q = bt2.QueryExecutor()
+        q = bt2.QueryExecutor(SinkWithFailingQuery, 'hello')
 
         with self.assertRaises(bt2._Error) as ctx:
-            q.query(SinkWithFailingQuery, 'hello')
+            q.query()
 
         cause = ctx.exception[0]
         self.assertIs(type(cause), bt2._ComponentClassErrorCause)
This page took 0.025584 seconds and 4 git commands to generate.