test_pillar.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # -*- coding: utf-8 -*-
  2. # Import Python libs
  3. from __future__ import absolute_import, print_function, unicode_literals
  4. # Import Salt Libs
  5. import salt.utils.platform
  6. # Import Salt Testing Libs
  7. from tests.support.case import SSHCase
  8. from tests.support.unit import skipIf
  9. @skipIf(salt.utils.platform.is_windows(), "salt-ssh not available on Windows")
  10. class SSHPillarTest(SSHCase):
  11. """
  12. testing pillar with salt-ssh
  13. """
  14. @skipIf(True, "SLOWTEST skip")
  15. def test_pillar_items(self):
  16. """
  17. test pillar.items with salt-ssh
  18. """
  19. ret = self.run_function("pillar.items")
  20. self.assertDictContainsSubset({"monty": "python"}, ret)
  21. self.assertDictContainsSubset(
  22. {"knights": ["Lancelot", "Galahad", "Bedevere", "Robin"]}, ret
  23. )
  24. @skipIf(True, "SLOWTEST skip")
  25. def test_pillar_get(self):
  26. """
  27. test pillar.get with salt-ssh
  28. """
  29. ret = self.run_function("pillar.get", ["monty"])
  30. self.assertEqual(ret, "python")
  31. @skipIf(True, "SLOWTEST skip")
  32. def test_pillar_get_doesnotexist(self):
  33. """
  34. test pillar.get when pillar does not exist with salt-ssh
  35. """
  36. ret = self.run_function("pillar.get", ["doesnotexist"])
  37. self.assertEqual(ret, "")