def test_enabled_and_wrong_output_type(self): with patch('lusmu.core.VERIFY_OUTPUT_TYPES', True): with assert_raises(TypeError) as exc: node = vector.Node(name='node', action=IntOutputTypeAction(), inputs=vector.Node.inputs(self.input)) self.input.value = np.array(['42']) node._evaluate() self.assertEqual( "The output value type 'string_' for [node]\n" "doesn't match the expected type 'int' for action " '"int_action".', str(exc.exception))
def test_enabled_and_correct_output_type(self): with patch('lusmu.core.VERIFY_OUTPUT_TYPES', True): node = vector.Node(action=IntOutputTypeAction(), inputs=vector.Node.inputs(self.input)) self.input.value = np.array([42]) node._evaluate()
def test_disabled_and_wrong_output_type(self): node = vector.Node(action=IntOutputTypeAction(), inputs=vector.Node.inputs(self.input)) self.input.value = np.array(['42']) node._evaluate()