Belle II Software development
TestCalibrationClass_Configure Class Reference
Inheritance diagram for TestCalibrationClass_Configure:

Public Member Functions

 setUp (self)
 
 test_1 (self)
 
 test_2 (self)
 
 test_3 (self)
 
 test_4 (self)
 
 test_5 (self)
 
 test_6 (self)
 
 tearDown (self)
 

Public Attributes

 alg1 = TestAlgo()
 Calibration algorithm for use in unittests.
 
 alg2 = TestAlgo()
 Calibration algorithm attribute for use in unittests.
 
 col1 = b2.register_module('CaTest')
 Collector module attribute for use in unittests.
 
 example_file1 = Path("example1.root")
 Path to an example file.
 
 example_file2 = Path("example2.root")
 Path to a second example file.
 

Detailed Description

UnitTest for configuration of Calibration class

Definition at line 23 of file test_framework.py.

Member Function Documentation

◆ setUp()

setUp ( self)
Create useful objects for each test

Definition at line 28 of file test_framework.py.

28 def setUp(self):
29 """
30 Create useful objects for each test
31 """
32 from ROOT import Belle2 # noqa: make the Belle2 namespace available
33 from ROOT.Belle2 import TestCalibrationAlgorithm as TestAlgo
34
35 self.alg1 = TestAlgo()
36
37 self.alg2 = TestAlgo()
38
39 self.col1 = b2.register_module('CaTest')
40
41 self.example_file1 = Path("example1.root")
42
43 self.example_file2 = Path("example2.root")
44 self.example_file1.touch()
45 self.example_file2.touch()
46

◆ tearDown()

tearDown ( self)
Unlink example files

Definition at line 99 of file test_framework.py.

99 def tearDown(self):
100 """
101 Unlink example files
102 """
103 self.example_file1.unlink()
104 self.example_file2.unlink()
105
106

◆ test_1()

test_1 ( self)
Test whether or not calibration is valid with incorrect setup.

Definition at line 47 of file test_framework.py.

47 def test_1(self):
48 """
49 Test whether or not calibration is valid with incorrect setup.
50 """
51 cal = Calibration('TestCalibrationClass_Configure_test1')
52 self.assertFalse(cal.is_valid())
53

◆ test_2()

test_2 ( self)
Test whether or not calibration is valid with incorrect setup.

Definition at line 54 of file test_framework.py.

54 def test_2(self):
55 """
56 Test whether or not calibration is valid with incorrect setup.
57 """
58 cal = Calibration('TestCalibrationClass_Configure_test2')
59 cal.collector = 'CaTest'
60 self.assertFalse(cal.is_valid())
61

◆ test_3()

test_3 ( self)
Test whether or not calibration is valid with incorrect setup.

Definition at line 62 of file test_framework.py.

62 def test_3(self):
63 """
64 Test whether or not calibration is valid with incorrect setup.
65 """
66 cal = Calibration('TestCalibrationClass_Configure_test3')
67 cal.collector = self.col1
68 self.assertFalse(cal.is_valid())
69

◆ test_4()

test_4 ( self)
Test whether or not calibration is valid with incorrect setup.

Definition at line 70 of file test_framework.py.

70 def test_4(self):
71 """
72 Test whether or not calibration is valid with incorrect setup.
73 """
74 cal = Calibration('TestCalibrationClass_Configure_test4')
75 cal.collector = self.col1
76 cal.algorithms = [self.alg1, self.alg2]
77 self.assertFalse(cal.is_valid())
78

◆ test_5()

test_5 ( self)
Test whether or not calibration is valid with correct setup.

Definition at line 79 of file test_framework.py.

79 def test_5(self):
80 """
81 Test whether or not calibration is valid with correct setup.
82 """
83 cal = Calibration('TestCalibrationClass_Configure_test5')
84 cal.collector = self.col1
85 cal.algorithms = [self.alg1, self.alg2]
86 cal.input_files = self.example_file1.as_posix()
87 self.assertTrue(cal.is_valid())
88

◆ test_6()

test_6 ( self)
Test whether or not calibration is valid with alternative correct setup.

Definition at line 89 of file test_framework.py.

89 def test_6(self):
90 """
91 Test whether or not calibration is valid with alternative correct setup.
92 """
93 cal = Calibration('TestCalibrationClass_Configure_test6')
94 cal.collector = self.col1
95 cal.algorithms = [self.alg1, self.alg2]
96 cal.input_files = [self.example_file1.as_posix(), self.example_file2.as_posix()]
97 self.assertTrue(cal.is_valid())
98

Member Data Documentation

◆ alg1

alg1 = TestAlgo()

Calibration algorithm for use in unittests.

Definition at line 35 of file test_framework.py.

◆ alg2

alg2 = TestAlgo()

Calibration algorithm attribute for use in unittests.

Definition at line 37 of file test_framework.py.

◆ col1

col1 = b2.register_module('CaTest')

Collector module attribute for use in unittests.

Definition at line 39 of file test_framework.py.

◆ example_file1

example_file1 = Path("example1.root")

Path to an example file.

Definition at line 41 of file test_framework.py.

◆ example_file2

example_file2 = Path("example2.root")

Path to a second example file.

Definition at line 43 of file test_framework.py.


The documentation for this class was generated from the following file: