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

Method test_getitem

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

Source from the content-addressed store, hash-verified

267 self.assertEqual(str(eval(s)), s)
268
269 def test_getitem(self):
270 v = [-0.1, 0.2, 0.3]
271 a = variable(*v)
272 for i in range(2):
273 self.assertEqual(a[i][0], v[i])
274 self.assertEqual(a[i][1], v[i + 1])
275 self.assertEqual(a[-1][0], -float("infinity"))
276 self.assertEqual(a[2][1], float("infinity"))
277 with self.assertRaises(IndexError):
278 a[-2]
279 with self.assertRaises(IndexError):
280 a[3]
281
282 def test_iter(self):
283 v = [-0.1, 0.2, 0.3]

Callers

nothing calls this directly

Calls 1

variableClass · 0.90

Tested by

no test coverage detected