Belle II Software  release-08-01-10
test_online_book_statistics.py
1 #!/usr/bin/env python3
2 
3 
10 
11 """
12 Test all the steering files used in the online_book lessons.
13 Proudly based on analysis/test/examples.py.
14 """
15 
16 # std
17 import unittest
18 import subprocess
19 from pathlib import Path
20 import inspect
21 
22 # basf2
23 from b2test_utils import clean_working_directory
24 
25 
26 src_file_path = inspect.getfile(lambda: None)
27 this_dir = Path(src_file_path).resolve().parent
28 statistics_script = this_dir.parent / "online_book_statistics.py"
29 
30 
31 class Test(unittest.TestCase):
32  """Test case for online book statistics"""
33  def test(self):
34  """Check that statistics creation works"""
35  subprocess.call(["python3", str(statistics_script.resolve())])
36 
37 
38 if __name__ == "__main__":
39  with clean_working_directory():
40  unittest.main()