X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=tests%2Fdata%2Fauto-source-discovery%2Fgrouping%2Fbt_plugin_test.py;fp=tests%2Fdata%2Fauto-source-discovery%2Fgrouping%2Fbt_plugin_test.py;h=208f53813a356455d80361de375f91d29ceb5279;hp=c885040ce7801c7ef8014906c778e270cfca9fdc;hb=f5567ea88d172767b34373bc6e402da8bfd85ef8;hpb=419d8c49bd978a59b8a0619d83cb6ba26b18f970 diff --git a/tests/data/auto-source-discovery/grouping/bt_plugin_test.py b/tests/data/auto-source-discovery/grouping/bt_plugin_test.py index c885040c..208f5381 100644 --- a/tests/data/auto-source-discovery/grouping/bt_plugin_test.py +++ b/tests/data/auto-source-discovery/grouping/bt_plugin_test.py @@ -14,8 +14,8 @@ import os class TestIter(bt2._UserMessageIterator): def __init__(self, config, output_port): - inputs = output_port.user_data['inputs'] - sc = output_port.user_data['sc'] + inputs = output_port.user_data["inputs"] + sc = output_port.user_data["sc"] tc = sc.trace_class t = tc() s = t.create_stream(sc, name=self._make_stream_name(inputs)) @@ -29,8 +29,8 @@ class TestIter(bt2._UserMessageIterator): comp_cls_name = self._component.__class__.__name__ return ( comp_cls_name - + ': ' - + ', '.join(sorted([os.path.basename(str(x)) for x in inputs])) + + ": " + + ", ".join(sorted([os.path.basename(str(x)) for x in inputs])) ) def __next__(self): @@ -45,7 +45,7 @@ class Base: tc = self._create_trace_class() sc = tc.create_stream_class() - self._add_output_port('out', {'inputs': params['inputs'], 'sc': sc}) + self._add_output_port("out", {"inputs": params["inputs"], "sc": sc}) @bt2.plugin_component_class @@ -62,17 +62,17 @@ class TestSourceExt(Base, bt2._UserSourceComponent, message_iterator_class=TestI @staticmethod def _user_query(priv_query_exec, obj, params, method_obj): - if obj == 'babeltrace.support-info': - if params['type'] == 'file': - name = os.path.basename(str(params['input'])) - - if name.startswith('aaa'): - return {'weight': 1, 'group': 'aaa'} - elif name.startswith('bbb'): - return {'weight': 0.5, 'group': 'bbb'} - elif name.startswith('ccc'): + if obj == "babeltrace.support-info": + if params["type"] == "file": + name = os.path.basename(str(params["input"])) + + if name.startswith("aaa"): + return {"weight": 1, "group": "aaa"} + elif name.startswith("bbb"): + return {"weight": 0.5, "group": "bbb"} + elif name.startswith("ccc"): # Try two different ways of returning 1 (an int and a float). - if name[3] == '1': + if name[3] == "1": return 1 else: return 1.0 @@ -95,10 +95,10 @@ class TestSourceSomeDir( @staticmethod def _user_query(priv_query_exec, obj, params, method_obj): - if obj == 'babeltrace.support-info': - if params['type'] == 'directory': - name = os.path.basename(str(params['input'])) - return 1 if name == 'some-dir' else 0 + if obj == "babeltrace.support-info": + if params["type"] == "directory": + name = os.path.basename(str(params["input"])) + return 1 if name == "some-dir" else 0 else: return 0 else: @@ -114,10 +114,10 @@ class TestSourceABCDE(Base, bt2._UserSourceComponent, message_iterator_class=Tes @staticmethod def _user_query(priv_query_exec, obj, params, method_obj): - if obj == 'babeltrace.support-info': + if obj == "babeltrace.support-info": return ( 1.0 - if params['type'] == 'string' and params['input'] == 'ABCDE' + if params["type"] == "string" and params["input"] == "ABCDE" else 0.0 ) else: