MCPcopy Create free account
hub / github.com/boostorg/histogram / test_init

Method test_init

test/python_suite_test.py:50–84  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48class test_regular(unittest.TestCase):
49
50 def test_init(self):
51 regular(1, 1.0, 2.0)
52 regular(1, 1.0, 2.0, label="ra")
53 regular(1, 1.0, 2.0, uoflow=False)
54 regular(1, 1.0, 2.0, label="ra", uoflow=False)
55 regular_log(1, 1.0, 2.0)
56 regular_sqrt(1, 1.0, 2.0)
57 regular_pow(1, 1.0, 2.0, 1.5)
58 with self.assertRaises(TypeError):
59 regular()
60 with self.assertRaises(TypeError):
61 regular(1)
62 with self.assertRaises(TypeError):
63 regular(1, 1.0)
64 with self.assertRaises(ValueError):
65 regular(0, 1.0, 2.0)
66 with self.assertRaises(TypeError):
67 regular("1", 1.0, 2.0)
68 with self.assertRaises(Exception):
69 regular(-1, 1.0, 2.0)
70 with self.assertRaises(ValueError):
71 regular(1, 2.0, 1.0)
72 with self.assertRaises(TypeError):
73 regular(1, 1.0, 2.0, label=0)
74 with self.assertRaises(TypeError):
75 regular(1, 1.0, 2.0, label="ra", uoflow="True")
76 with self.assertRaises(TypeError):
77 regular(1, 1.0, 2.0, bad_keyword="ra")
78 with self.assertRaises(TypeError):
79 regular_pow(1, 1.0, 2.0)
80 a = regular(4, 1.0, 2.0)
81 self.assertEqual(a, regular(4, 1.0, 2.0))
82 self.assertNotEqual(a, regular(3, 1.0, 2.0))
83 self.assertNotEqual(a, regular(4, 1.1, 2.0))
84 self.assertNotEqual(a, regular(4, 1.0, 2.1))
85
86 def test_len(self):
87 a = regular(4, 1.0, 2.0)

Callers

nothing calls this directly

Calls 1

regularClass · 0.90

Tested by

no test coverage detected