Belle II Software light-2406-ragdoll
test_b2help_recommendation.py
1
8
9'''
10Test for checking:
11 - b2help-recommendation
12 - b2help-recommendation -t gamma
13'''
14
15import basf2
16import b2test_utils
17import subprocess
18import shlex
19
20
21def call_command(command):
22 """Call command print output after having removed some lines from output
23
24 Args:
25 command (string): command to be called
26 """
27 output = subprocess.check_output(shlex.split(command), encoding='utf-8').strip().split('\n')
28 for line in output:
29 if "provider = " not in line:
30 print(line)
31
32
33if __name__ == '__main__':
35 check_tags = ['all', 'gamma', 'Tracking']
36 filename = basf2.find_file('framework/tests/test_b2help_recommendation_payload.json')
37 # List available tags
38 call_command(f'b2help-recommendation -l {filename}')
39 # Call the script for tags
40 for tag in check_tags:
41 call_command(f'b2help-recommendation -t {tag} -l {filename}')
42 # Call convert to payload
43 call_command(f'b2help-recommendation -l {filename} -t {check_tags[1]} -c -p test')
def configure_logging_for_tests(user_replacements=None)
Definition: __init__.py:106