X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_component.py;fp=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_component.py;h=a0e05b918b92502e3a9d077635d7b764f800e5c4;hb=1c9ed2ffbefa751380762afde8779239716c020e;hp=77d346b62c7cdea1024b84623029470d9c4cd6fb;hpb=601c002660cfc2434293a50a1bec418a6b41fdaf;p=babeltrace.git diff --git a/tests/bindings/python/bt2/test_component.py b/tests/bindings/python/bt2/test_component.py index 77d346b6..a0e05b91 100644 --- a/tests/bindings/python/bt2/test_component.py +++ b/tests/bindings/python/bt2/test_component.py @@ -4,7 +4,6 @@ import copy import bt2 -@unittest.skip("this is broken") class UserComponentTestCase(unittest.TestCase): @staticmethod def _create_comp(comp_cls, name=None): @@ -13,7 +12,7 @@ class UserComponentTestCase(unittest.TestCase): if name is None: name = 'comp' - return graph.add_component(comp_cls, name) + return graph.add_sink_component(comp_cls, name) def test_name(self): class MySink(bt2._UserSinkComponent): @@ -25,19 +24,6 @@ class UserComponentTestCase(unittest.TestCase): comp = self._create_comp(MySink, 'yaes') - def test_graph(self): - class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params): - nonlocal graph - self.assertEqual(comp_self.graph, graph) - - def _consume(self): - pass - - graph = bt2.Graph() - comp = graph.add_component(MySink, 'lel') - del graph - def test_class(self): class MySink(bt2._UserSinkComponent): def __init__(comp_self, params): @@ -71,13 +57,13 @@ class UserComponentTestCase(unittest.TestCase): finalized = True graph = bt2.Graph() - comp = graph.add_component(MySink, 'lel') + comp = graph.add_sink_component(MySink, 'lel') + del graph del comp self.assertTrue(finalized) -@unittest.skip("this is broken") class GenericComponentTestCase(unittest.TestCase): @staticmethod def _create_comp(comp_cls, name=None): @@ -86,7 +72,7 @@ class GenericComponentTestCase(unittest.TestCase): if name is None: name = 'comp' - return graph.add_component(comp_cls, name) + return graph.add_sink_component(comp_cls, name) def test_name(self): class MySink(bt2._UserSinkComponent): @@ -96,15 +82,6 @@ class GenericComponentTestCase(unittest.TestCase): comp = self._create_comp(MySink, 'yaes') self.assertEqual(comp.name, 'yaes') - def test_graph(self): - class MySink(bt2._UserSinkComponent): - def _consume(self): - pass - - graph = bt2.Graph() - comp = graph.add_component(MySink, 'lel') - self.assertEqual(comp.graph, graph) - def test_class(self): class MySink(bt2._UserSinkComponent): def _consume(self):