X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_event.py;h=e4a0f7549e8e813ad3d562d831e2c66f162deb55;hb=57081273d1191fc79edc101af619fab96b72460d;hp=74fe7cff1e374d4e044fda296b5748f3dedfdbf7;hpb=cfbd7cf3bde05e8a6606478889dcd663604ef7b5;p=babeltrace.git diff --git a/tests/bindings/python/bt2/test_event.py b/tests/bindings/python/bt2/test_event.py index 74fe7cff..e4a0f754 100644 --- a/tests/bindings/python/bt2/test_event.py +++ b/tests/bindings/python/bt2/test_event.py @@ -16,9 +16,9 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -from collections import OrderedDict import unittest import bt2 +from utils import TestOutputPortMessageIterator class EventTestCase(unittest.TestCase): @@ -75,7 +75,7 @@ class EventTestCase(unittest.TestCase): return msg class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params): + def __init__(self, params, obj): self._add_output_port('out') tc = self._create_trace_class() @@ -153,8 +153,8 @@ class EventTestCase(unittest.TestCase): test_obj = self self._graph = bt2.Graph() self._src_comp = self._graph.add_component(MySrc, 'my_source') - self._msg_iter = self._graph.create_output_port_message_iterator( - self._src_comp.output_ports['out'] + self._msg_iter = TestOutputPortMessageIterator( + self._graph, self._src_comp.output_ports['out'] ) for msg in self._msg_iter: @@ -229,7 +229,9 @@ class EventTestCase(unittest.TestCase): def test_no_clock_value(self): msg = self._create_test_event_message(with_clockclass=False) - with self.assertRaises(bt2.NonexistentClockSnapshot): + with self.assertRaisesRegex( + ValueError, 'stream class has no default clock class' + ): msg.default_clock_snapshot def test_stream(self):