nginx-formula/tests/pytests/apply-all-tests/test_000_apply_state.py

24 lines
672 B
Python
Raw Normal View History

2018-03-17 21:25:25 +01:00
from subprocess import check_output
from unittest import TestCase
class ApplyStateTest(TestCase):
def test_000_apply(self):
state_apply_response = check_output(["salt-call", "--local", "state.apply"])
print('')
print('-' * 50)
print('state_apply_response:')
print(state_apply_response)
print('-' * 50)
print('')
state_apply_response = state_apply_response.split('\n')
summary = state_apply_response[-8:]
failed = 0
for line in summary:
if line.startswith('Failed:'):
failed = int(line.split(':').pop().strip())
self.assertEqual(failed, 0)