test_files.py 971 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. """
  3. Tests for the spm files utility
  4. """
  5. from __future__ import absolute_import, print_function, unicode_literals
  6. import os
  7. import shutil
  8. import pytest
  9. from tests.support.case import SPMCase
  10. @pytest.mark.destructive_test
  11. @pytest.mark.windows_whitelisted
  12. class SPMFilesTest(SPMCase):
  13. """
  14. Validate the spm files command
  15. """
  16. def setUp(self):
  17. self.config = self._spm_config()
  18. self._spm_build_files(self.config)
  19. @pytest.mark.slow_test(seconds=5) # Test takes >1 and <=5 seconds
  20. def test_spm_files(self):
  21. """
  22. test spm files
  23. """
  24. self._spm_create_update_repo(self.config)
  25. install = self.run_spm("install", self.config, "apache")
  26. get_files = self.run_spm("files", self.config, "apache")
  27. os.path.exists(
  28. os.path.join(self.config["formula_path"], "apache", "apache.sls")
  29. )
  30. def tearDown(self):
  31. shutil.rmtree(self._tmp_spm)