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