salt/tests/integration/states/handle_error.py
Mathieu Le Marec - Pasquet 165b5e4af2 Handle better state errors
This fixes #9983.
2014-01-28 16:01:34 +01:00

35 lines
880 B
Python

# -*- coding: utf-8 -*-
'''
tests for host state
'''
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class HandleErrorTest(integration.ModuleCase):
'''
Validate that ordering works correctly
'''
def test_handle_error(self):
'''
Test how an error can be recovered
'''
# without sync_states, the custom state may not be installed
# (resulting in :
# State salttest.hello found in sls issue-... is unavailable
ret = self.run_function('state.sls', ['issue-9983-handleerror'])
self.assertTrue(
'An exception occurred in this state: Traceback'
in ret[[a for a in ret][0]]['comment'])
if __name__ == '__main__':
from integration import run_tests
run_tests(HandleErrorTest)