Ejemplo n.º 1
0
 def testChooseInitializer_Real(self):
   domain = Domain(type=Domain.REAL, low=Real(20), high=Real(40))
   initializer = domain.chooseInitializer()
   self.assertTrue(initializer.is_real)
   self.assertTrue(initializer >= domain.low)
   self.assertTrue(initializer <= domain.high)
Ejemplo n.º 2
0
 def testChooseInitializer_Fraction(self):
   domain = Domain(type=Domain.FRACTION, low=-23, high=435)
   initializer = domain.chooseInitializer()
   self.assertTrue(initializer.is_rational)
   self.assertTrue(initializer >= Rational(domain.low, domain.high))
   self.assertTrue(initializer <= abs(Rational(domain.high, domain.low)))
Ejemplo n.º 3
0
 def testChooseInitializer_Integer(self):
   domain = Domain(type=Domain.WHOLE_NUMBER, low=Integer(20), high=Integer(40))
   initializer = domain.chooseInitializer()
   self.assertTrue(initializer.is_integer)
   self.assertTrue(initializer >= domain.low)
   self.assertTrue(initializer <= domain.high)