def testInfinityUpperPos(self): interval = spanningInterval.Interval(OP, 1, PINF, CL) self.assertEqual(interval.contains(0), False) self.assertEqual(interval.contains(0.5), False) self.assertEqual(interval.contains(1), False) self.assertEqual(interval.contains(2), True) self.assertEqual(interval.contains(-1), False)
def testInfinityLowerNeg(self): interval = spanningInterval.Interval(OP, NINF, 1, CL) self.assertEqual(interval.contains(0), True) self.assertEqual(interval.contains(0.5), True) self.assertEqual(interval.contains(1), True) self.assertEqual(interval.contains(2), False) self.assertEqual(interval.contains(-1), True)
def testOPInterval(self): interval = spanningInterval.Interval(OP, 0, 1, OP) self.assertEqual(interval.contains(0), False) self.assertEqual(interval.contains(0.5), True) self.assertEqual(interval.contains(1), False) self.assertEqual(interval.contains(2), False) self.assertEqual(interval.contains(-1), False)
def testCLInterval(self): interval = spanningInterval.Interval(CL, 0, 1, CL) self.assertEqual(interval.contains(0), True) self.assertEqual(interval.contains(0.5), True) self.assertEqual(interval.contains(1), True) self.assertEqual(interval.contains(2), False) self.assertEqual(interval.contains(-1), False)