def test_should_constructor_create_a_valid_operator(self): operator = IntegerPolynomial(0.5, 20) self.assertEqual(0.5, operator.probability) self.assertEqual(20, operator.distribution_index)
def test_should_constructor_raise_an_exception_if_the_probability_is_greater_than_one( self): with self.assertRaises(Exception): IntegerPolynomial(2)
def test_should_constructor_create_a_non_null_object(self): operator = IntegerPolynomial(1.0) self.assertIsNotNone(operator)