salt/tests/integration/states/test_compiler.py

35 lines
914 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2012-05-17 05:00:01 +00:00
'''
tests for host state
'''
# Import python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
2012-05-17 05:00:01 +00:00
2012-05-29 16:40:20 +00:00
class CompileTest(ModuleCase):
2012-05-17 05:00:01 +00:00
'''
Validate the state compiler
'''
def test_multi_state(self):
'''
Test the error with multiple states of the same type
'''
ret = self.run_function('state.sls', mods='fuzz.multi_state')
# Verify that the return is a list, aka, an error
2012-07-23 19:00:54 +00:00
self.assertIsInstance(ret, list)
def test_jinja_deep_error(self):
'''
Test when we have an error in a execution module
called by jinja
'''
ret = self.run_function('state.sls', ['issue-10010'])
self.assertTrue(
', in jinja_error' in ret[0].strip())
self.assertTrue(
ret[0].strip().endswith('Exception: hehehe'))