Пример #1
0
 def test_name_validator_direction_constructor_gives_correct_object(self):
     """
         Test the constructor that takes a name, validator & direction
     """
     name = "numbers"
     direc = Direction.Output
     validator = NullValidator()
     arr = FloatArrayProperty(name, validator, direc)
     self._check_object_attributes(arr, name, direc)
     self.assertEquals(arr.isValid(), "")
Пример #2
0
 def test_name_string_values_validator_direction_constructor_gives_correct_object(self):
     """
         Test the constructor that takes a name, values as string, validator & direction
     """
     name = "numbers"
     direc = Direction.Output
     validator = NullValidator()
     values_str = "1.345,34.2,5345.3,4,5.3948"
     arr = FloatArrayProperty(name, values_str, validator, direc)
     self._check_object_attributes(arr, name, direc, length = 5)
     self.assertEquals(arr.isValid(), "")
     values = arr.value
     self.assertTrue(isinstance(values, np.ndarray))