test_handle_iorder.py 835 B

1234567891011121314151617181920212223242526272829303132
  1. # -*- coding: utf-8 -*-
  2. """
  3. tests for host state
  4. """
  5. # Import Python libs
  6. from __future__ import absolute_import, print_function, unicode_literals
  7. import pytest
  8. # Import Salt Testing libs
  9. from tests.support.case import ModuleCase
  10. class HandleOrderTest(ModuleCase):
  11. """
  12. Validate that ordering works correctly
  13. """
  14. @pytest.mark.slow_test(seconds=5) # Test takes >1 and <=5 seconds
  15. def test_handle_iorder(self):
  16. """
  17. Test the error with multiple states of the same type
  18. """
  19. ret = self.run_function("state.show_low_sls", mods="issue-7649-handle-iorder")
  20. sorted_chunks = [
  21. chunk["name"] for chunk in sorted(ret, key=lambda c: c.get("order"))
  22. ]
  23. expected = ["./configure", "make", "make install"]
  24. self.assertEqual(expected, sorted_chunks)