test_pillar_include.py 819 B

1234567891011121314151617181920212223242526272829
  1. # -*- coding: utf-8 -*-
  2. """
  3. Pillar include tests
  4. """
  5. from __future__ import absolute_import, unicode_literals
  6. from tests.support.case import ModuleCase
  7. class PillarIncludeTest(ModuleCase):
  8. def test_pillar_include(self):
  9. """
  10. Test pillar include
  11. """
  12. ret = self.minion_run("pillar.items")
  13. assert "a" in ret["element"]
  14. assert ret["element"]["a"] == {"a": ["Entry A"]}
  15. assert "b" in ret["element"]
  16. assert ret["element"]["b"] == {"b": ["Entry B"]}
  17. def test_pillar_glob_include(self):
  18. """
  19. Test pillar include via glob pattern
  20. """
  21. ret = self.minion_run("pillar.items")
  22. assert "glob-a" in ret
  23. assert ret["glob-a"] == ["Entry A"]
  24. assert "glob-b" in ret
  25. assert ret["glob-b"] == ["Entry B"]