test_files.py 928 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # -*- coding: utf-8 -*-
  2. '''
  3. Tests for the spm files utility
  4. '''
  5. # Import python libs
  6. from __future__ import absolute_import, print_function, unicode_literals
  7. import os
  8. import shutil
  9. import pytest
  10. # Import Salt Testing libs
  11. from tests.support.case import SPMCase
  12. @pytest.mark.destructive_test
  13. class SPMFilesTest(SPMCase):
  14. '''
  15. Validate the spm files command
  16. '''
  17. def setUp(self):
  18. self.config = self._spm_config()
  19. self._spm_build_files(self.config)
  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(os.path.join(self.config['formula_path'], 'apache',
  28. 'apache.sls'))
  29. def tearDown(self):
  30. shutil.rmtree(self._tmp_spm)