X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_error.py;h=1126ca7086ea974ab39f43ce66e1f64a869282fd;hb=ffecc00e2725dea0af6a7e0cfb10a95b8f56ee68;hp=0bdd6ce3673a2c92c434299507bf6bd464307c77;hpb=8258c4bd94a2ed6e3c23cd6c21c331b75d1ae52b;p=babeltrace.git diff --git a/tests/bindings/python/bt2/test_error.py b/tests/bindings/python/bt2/test_error.py index 0bdd6ce3..1126ca70 100644 --- a/tests/bindings/python/bt2/test_error.py +++ b/tests/bindings/python/bt2/test_error.py @@ -1,20 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2019 EfficiOS Inc. # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; only version 2 -# of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# from bt2 import native_bt import bt2 @@ -29,34 +16,34 @@ class FailingIter(bt2._UserMessageIterator): class SourceWithFailingIter( bt2._UserSourceComponent, message_iterator_class=FailingIter ): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class SourceWithFailingInit( bt2._UserSourceComponent, message_iterator_class=FailingIter ): - def __init__(self, params, obj): + def __init__(self, config, params, obj): raise ValueError('Source is failing') class WorkingSink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._in = self._add_input_port('in') def _user_graph_is_configured(self): - self._iter = self._create_input_port_message_iterator(self._in) + self._iter = self._create_message_iterator(self._in) def _user_consume(self): next(self._iter) class SinkWithExceptionChaining(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._in = self._add_input_port('in') def _user_graph_is_configured(self): - self._iter = self._create_input_port_message_iterator(self._in) + self._iter = self._create_message_iterator(self._in) def _user_consume(self): try: @@ -211,7 +198,7 @@ class ErrorTestCase(unittest.TestCase): # expected bits. exc = self._run_failing_graph(SourceWithFailingIter, SinkWithExceptionChaining) s = str(exc) - self.assertIn('[src (out): src.SourceWithFailingIter]', s) + self.assertIn("[src (out): 'source.SourceWithFailingIter']", s) self.assertIn('ValueError: oops', s)