Belle II Software development
test_online_book_statistics.py
1#!/usr/bin/env python3
2
3
10
11"""
12Test all the steering files used in the online_book lessons.
13Proudly based on analysis/test/examples.py.
14"""
15
16# std
17import unittest
18import subprocess
19from pathlib import Path
20import inspect
21
22# basf2
23from b2test_utils import clean_working_directory
24
25
26src_file_path = inspect.getfile(lambda: None)
27this_dir = Path(src_file_path).resolve().parent
28statistics_script = this_dir.parent / "online_book_statistics.py"
29
30
31class 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
38if __name__ == "__main__":
39 with clean_working_directory():
40 unittest.main()