ATLAS Offline Software
Loading...
Searching...
No Matches
python.EventSelectionConfigHelpers_unitTest.TestHelpers Class Reference
Inheritance diagram for python.EventSelectionConfigHelpers_unitTest.TestHelpers:
Collaboration diagram for python.EventSelectionConfigHelpers_unitTest.TestHelpers:

Public Member Functions

 setUp (self)
 test_check_float_ok (self)
 test_check_float_rejects_negative (self)
 test_check_float_allows_negative_when_not_required (self)
 test_check_float_rejects_nonnumeric (self)
 test_check_int_ok (self)
 test_check_int_rejects_float (self)
 test_check_int_rejects_negative (self)
 test_check_sign_ok (self)
 test_check_sign_rejects_unknown (self)
 test_check_btagging_ok (self)
 test_check_btagging_rejects_malformed (self)
 test_check_ghosts_single (self)
 test_check_ghosts_with_veto (self)
 test_check_ghosts_passthrough_unknown (self)
 test_check_decoration_empty (self)
 test_check_decoration_appends_as_char (self)
 test_check_decoration_preserves_existing (self)
 test_check_decoration_and_chain (self)

Public Attributes

 b = EventSelectionConfig()

Detailed Description

Definition at line 10 of file EventSelectionConfigHelpers_unitTest.py.

Member Function Documentation

◆ setUp()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.setUp ( self)

Definition at line 11 of file EventSelectionConfigHelpers_unitTest.py.

11 def setUp(self):
12 self.b = EventSelectionConfig()
13

◆ test_check_btagging_ok()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_btagging_ok ( self)

Definition at line 43 of file EventSelectionConfigHelpers_unitTest.py.

43 def test_check_btagging_ok(self):
44 self.assertEqual(self.b.check_btagging("GN2v01:FixedCutBEff_85"),
45 ["GN2v01", "FixedCutBEff_85"])
46

◆ test_check_btagging_rejects_malformed()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_btagging_rejects_malformed ( self)

Definition at line 47 of file EventSelectionConfigHelpers_unitTest.py.

47 def test_check_btagging_rejects_malformed(self):
48 self.assertRaises(ValueError, self.b.check_btagging, "GN2v01")
49

◆ test_check_decoration_and_chain()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_decoration_and_chain ( self)

Definition at line 74 of file EventSelectionConfigHelpers_unitTest.py.

74 def test_check_decoration_and_chain(self):
75 self.assertEqual(self.b.checkDecorationName("a_%SYS%&&b_%SYS%,as_char"),
76 "a_%SYS%,as_char&&b_%SYS%,as_char")
77
78

◆ test_check_decoration_appends_as_char()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_decoration_appends_as_char ( self)

Definition at line 68 of file EventSelectionConfigHelpers_unitTest.py.

68 def test_check_decoration_appends_as_char(self):
69 self.assertEqual(self.b.checkDecorationName("foo_%SYS%"), "foo_%SYS%,as_char")
70

◆ test_check_decoration_empty()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_decoration_empty ( self)

Definition at line 65 of file EventSelectionConfigHelpers_unitTest.py.

65 def test_check_decoration_empty(self):
66 self.assertEqual(self.b.checkDecorationName(""), "")
67

◆ test_check_decoration_preserves_existing()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_decoration_preserves_existing ( self)

Definition at line 71 of file EventSelectionConfigHelpers_unitTest.py.

71 def test_check_decoration_preserves_existing(self):
72 self.assertEqual(self.b.checkDecorationName("foo_%SYS%,as_char"), "foo_%SYS%,as_char")
73

◆ test_check_float_allows_negative_when_not_required()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_float_allows_negative_when_not_required ( self)

Definition at line 21 of file EventSelectionConfigHelpers_unitTest.py.

21 def test_check_float_allows_negative_when_not_required(self):
22 self.assertEqual(self.b.check_float("-1", requirePositive=False), -1.0)
23

◆ test_check_float_ok()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_float_ok ( self)

Definition at line 14 of file EventSelectionConfigHelpers_unitTest.py.

14 def test_check_float_ok(self):
15 for text, exp in [("0", 0.0), ("25000", 25000.0), ("1.5", 1.5)]:
16 self.assertEqual(self.b.check_float(text), exp)
17

◆ test_check_float_rejects_negative()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_float_rejects_negative ( self)

Definition at line 18 of file EventSelectionConfigHelpers_unitTest.py.

18 def test_check_float_rejects_negative(self):
19 self.assertRaises(ValueError, self.b.check_float, "-1")
20

◆ test_check_float_rejects_nonnumeric()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_float_rejects_nonnumeric ( self)

Definition at line 24 of file EventSelectionConfigHelpers_unitTest.py.

24 def test_check_float_rejects_nonnumeric(self):
25 self.assertRaises(ValueError, self.b.check_float, "abc")
26

◆ test_check_ghosts_passthrough_unknown()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_ghosts_passthrough_unknown ( self)

Definition at line 62 of file EventSelectionConfigHelpers_unitTest.py.

62 def test_check_ghosts_passthrough_unknown(self):
63 self.assertEqual(self.b.check_ghosts("MyCustomGhost"), ["MyCustomGhost"])
64

◆ test_check_ghosts_single()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_ghosts_single ( self)

Definition at line 50 of file EventSelectionConfigHelpers_unitTest.py.

50 def test_check_ghosts_single(self):
51 cases = {"B": "GhostBHadronsFinalCount", "C": "GhostCHadronsFinalCount",
52 "T": "GhostTQuarksFinalCount", "W": "GhostWBosonsCount",
53 "Z": "GhostZBosonsCount", "H": "GhostHBosonsCount",
54 "TAU": "GhostTausFinalCount"}
55 for token, exp in cases.items():
56 self.assertEqual(self.b.check_ghosts(token), [exp])
57

◆ test_check_ghosts_with_veto()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_ghosts_with_veto ( self)

Definition at line 58 of file EventSelectionConfigHelpers_unitTest.py.

58 def test_check_ghosts_with_veto(self):
59 self.assertEqual(self.b.check_ghosts("B!C"),
60 ["GhostBHadronsFinalCount", "GhostCHadronsFinalCount"])
61

◆ test_check_int_ok()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_int_ok ( self)

Definition at line 27 of file EventSelectionConfigHelpers_unitTest.py.

27 def test_check_int_ok(self):
28 self.assertEqual(self.b.check_int("2"), 2)
29

◆ test_check_int_rejects_float()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_int_rejects_float ( self)

Definition at line 30 of file EventSelectionConfigHelpers_unitTest.py.

30 def test_check_int_rejects_float(self):
31 self.assertRaises(ValueError, self.b.check_int, "1.5")
32

◆ test_check_int_rejects_negative()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_int_rejects_negative ( self)

Definition at line 33 of file EventSelectionConfigHelpers_unitTest.py.

33 def test_check_int_rejects_negative(self):
34 self.assertRaises(ValueError, self.b.check_int, "-3")
35

◆ test_check_sign_ok()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_sign_ok ( self)

Definition at line 36 of file EventSelectionConfigHelpers_unitTest.py.

36 def test_check_sign_ok(self):
37 for sym, enum in [("<", "LT"), (">", "GT"), ("==", "EQ"), (">=", "GE"), ("<=", "LE")]:
38 self.assertEqual(self.b.check_sign(sym), enum)
39

◆ test_check_sign_rejects_unknown()

python.EventSelectionConfigHelpers_unitTest.TestHelpers.test_check_sign_rejects_unknown ( self)

Definition at line 40 of file EventSelectionConfigHelpers_unitTest.py.

40 def test_check_sign_rejects_unknown(self):
41 self.assertRaises(KeyError, self.b.check_sign, "=!")
42

Member Data Documentation

◆ b

python.EventSelectionConfigHelpers_unitTest.TestHelpers.b = EventSelectionConfig()

Definition at line 12 of file EventSelectionConfigHelpers_unitTest.py.


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