projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: rename "self comp. input port message iter." -> "message iterator"
[babeltrace.git]
/
tests
/
bindings
/
python
/
bt2
/
test_graph.py
diff --git
a/tests/bindings/python/bt2/test_graph.py
b/tests/bindings/python/bt2/test_graph.py
index 3a52dd45a3850d09637324476598d51f3423a76c..5eb83f4097c6079178c4a039245082c10e50d2e0 100644
(file)
--- a/
tests/bindings/python/bt2/test_graph.py
+++ b/
tests/bindings/python/bt2/test_graph.py
@@
-65,6
+65,10
@@
class GraphTestCase(unittest.TestCase):
with self.assertRaisesRegex(ValueError, 'unknown MIP version'):
bt2.Graph(1)
with self.assertRaisesRegex(ValueError, 'unknown MIP version'):
bt2.Graph(1)
+ def test_default_interrupter(self):
+ interrupter = self._graph.default_interrupter
+ self.assertIs(type(interrupter), bt2.Interrupter)
+
def test_add_component_user_cls(self):
class MySink(bt2._UserSinkComponent):
def _user_consume(self):
def test_add_component_user_cls(self):
class MySink(bt2._UserSinkComponent):
def _user_consume(self):
@@
-212,11
+216,9
@@
class GraphTestCase(unittest.TestCase):
self.assertEqual(comp.logging_level, bt2.LoggingLevel.DEBUG)
def test_connect_ports(self):
self.assertEqual(comp.logging_level, bt2.LoggingLevel.DEBUG)
def test_connect_ports(self):
- class MyIter(bt2._UserMessageIterator):
- def __next__(self):
- raise bt2.Stop
-
- class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
+ class MySource(
+ bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+ ):
def __init__(self, config, params, obj):
self._add_output_port('out')
def __init__(self, config, params, obj):
self._add_output_port('out')
@@
-239,11
+241,9
@@
class GraphTestCase(unittest.TestCase):
self.assertEqual(sink.input_ports['in'].connection.addr, conn.addr)
def test_connect_ports_invalid_direction(self):
self.assertEqual(sink.input_ports['in'].connection.addr, conn.addr)
def test_connect_ports_invalid_direction(self):
- class MyIter(bt2._UserMessageIterator):
- def __next__(self):
- raise bt2.Stop
-
- class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
+ class MySource(
+ bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+ ):
def __init__(self, config, params, obj):
self._add_output_port('out')
def __init__(self, config, params, obj):
self._add_output_port('out')
@@
-277,9
+277,7
@@
class GraphTestCase(unittest.TestCase):
next(self._msg_iter)
def _user_graph_is_configured(self):
next(self._msg_iter)
def _user_graph_is_configured(self):
- self._msg_iter = self._create_input_port_message_iterator(
- self._input_ports['in']
- )
+ self._msg_iter = self._create_message_iterator(self._input_ports['in'])
# add two interrupters, set one of them
interrupter1 = bt2.Interrupter()
# add two interrupters, set one of them
interrupter1 = bt2.Interrupter()
@@
-321,13
+319,11
@@
class GraphTestCase(unittest.TestCase):
def _user_consume(self):
# Pretend that somebody asynchronously interrupted the graph.
nonlocal graph
def _user_consume(self):
# Pretend that somebody asynchronously interrupted the graph.
nonlocal graph
- graph.
interrup
t()
+ graph.
default_interrupter.se
t()
return next(self._msg_iter)
def _user_graph_is_configured(self):
return next(self._msg_iter)
def _user_graph_is_configured(self):
- self._msg_iter = self._create_input_port_message_iterator(
- self._input_ports['in']
- )
+ self._msg_iter = self._create_message_iterator(self._input_ports['in'])
graph = self._graph
up = self._graph.add_component(MySource, 'down')
graph = self._graph
up = self._graph.add_component(MySource, 'down')
@@
-384,9
+380,7
@@
class GraphTestCase(unittest.TestCase):
comp_self._at += 1
def _user_graph_is_configured(self):
comp_self._at += 1
def _user_graph_is_configured(self):
- self._msg_iter = self._create_input_port_message_iterator(
- self._input_port
- )
+ self._msg_iter = self._create_message_iterator(self._input_port)
src = self._graph.add_component(MySource, 'src')
sink = self._graph.add_component(MySink, 'sink')
src = self._graph.add_component(MySource, 'src')
sink = self._graph.add_component(MySink, 'sink')
@@
-482,9
+476,7
@@
class GraphTestCase(unittest.TestCase):
comp_self._at += 1
def _user_graph_is_configured(self):
comp_self._at += 1
def _user_graph_is_configured(self):
- self._msg_iter = self._create_input_port_message_iterator(
- self._input_port
- )
+ self._msg_iter = self._create_message_iterator(self._input_port)
src = self._graph.add_component(MySource, 'src')
sink = self._graph.add_component(MySink, 'sink')
src = self._graph.add_component(MySource, 'src')
sink = self._graph.add_component(MySink, 'sink')
@@
-539,9
+531,7
@@
class GraphTestCase(unittest.TestCase):
comp_self._at += 1
def _user_graph_is_configured(self):
comp_self._at += 1
def _user_graph_is_configured(self):
- self._msg_iter = self._create_input_port_message_iterator(
- self._input_port
- )
+ self._msg_iter = self._create_message_iterator(self._input_port)
src = self._graph.add_component(MySource, 'src')
sink = self._graph.add_component(MySink, 'sink')
src = self._graph.add_component(MySource, 'src')
sink = self._graph.add_component(MySink, 'sink')
@@
-551,11
+541,9
@@
class GraphTestCase(unittest.TestCase):
self._graph.run()
def test_listeners(self):
self._graph.run()
def test_listeners(self):
- class MyIter(bt2._UserMessageIterator):
- def __next__(self):
- raise bt2.Stop
-
- class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
+ class MySource(
+ bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+ ):
def __init__(self, config, params, obj):
self._add_output_port('out')
self._add_output_port('zero')
def __init__(self, config, params, obj):
self._add_output_port('out')
self._add_output_port('zero')
@@
-599,11
+587,9
@@
class GraphTestCase(unittest.TestCase):
self.assertEqual(calls[3][2].name, 'taste')
def test_invalid_listeners(self):
self.assertEqual(calls[3][2].name, 'taste')
def test_invalid_listeners(self):
- class MyIter(bt2._UserMessageIterator):
- def __next__(self):
- raise bt2.Stop
-
- class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
+ class MySource(
+ bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+ ):
def __init__(self, config, params, obj):
self._add_output_port('out')
self._add_output_port('zero')
def __init__(self, config, params, obj):
self._add_output_port('out')
self._add_output_port('zero')
This page took
0.025858 seconds
and
4
git commands to generate.