Belle II Software development
test_b2help_decay.py
1
8
9import subprocess
10import shlex
11
12
13def call_command(command):
14 """Call command print output after having removed some lines from output
15
16 Args:
17 command (string): command to be called
18 """
19 output = subprocess.check_output(shlex.split(command), encoding='utf-8').strip().split('\n')
20 return output
21
22
23if __name__ == '__main__':
24 output = call_command('b2help-decay print 1111440100')
25 assert len(output) > 10
26 output = call_command('b2help-decay print 1111440100.dec')
27 assert len(output) > 10
28 output = call_command('b2help-decay find K_S0 J/psi B0')
29 assert len(output) > 10
30 output = call_command('b2help-decay find K_S0 J/psi -m B0 -b')
31 assert len(output) > 2