예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)