Belle II Software
light-2406-ragdoll
test_b2help_recommendation.py
1
8
9
'''
10
Test for checking:
11
- b2help-recommendation
12
- b2help-recommendation -t gamma
13
'''
14
15
import basf2
16
import b2test_utils
17
import subprocess
18
import shlex
19
20
21
def 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
33
if
__name__ ==
'__main__'
:
34
b2test_utils.configure_logging_for_tests
()
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'
)
b2test_utils.configure_logging_for_tests
def configure_logging_for_tests(user_replacements=None)
Definition:
__init__.py:106
framework
tests
test_b2help_recommendation.py
Generated on Tue Jul 9 2024 23:29:18 for Belle II Software by
1.9.6