def test_template_unsafe_non_string(self): unsafe_obj = AnsibleUnsafe() res = self.templar.template(unsafe_obj) self.assertTrue( self.is_unsafe(res), 'returned value from template.template (%s) is not marked unsafe' % res)
def test_template_unsafe_non_string_clean_data_exception( self, mock_clean_data): msg = 'Error raised from _clean_data by test_template_unsafe_non_string_clean_data_exception' mock_clean_data.side_effect = AnsibleError(msg) unsafe_obj = AnsibleUnsafe() res = self.templar.template(unsafe_obj) self.assertTrue( self.is_unsafe(res), 'returned value from template.template (%s) is not marked unsafe' % res)