1
0

test_repo.py 908 B

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- coding: utf-8 -*-
  2. '''
  3. Tests for the spm repo
  4. '''
  5. # Import python libs
  6. from __future__ import absolute_import, print_function, unicode_literals
  7. import os
  8. import shutil
  9. # Import Salt Testing libs
  10. from tests.support.case import SPMCase
  11. from tests.support.helpers import destructiveTest
  12. @destructiveTest
  13. class SPMRepoTest(SPMCase):
  14. '''
  15. Validate commands related to spm repo
  16. '''
  17. def setUp(self):
  18. self.config = self._spm_config()
  19. self._spm_build_files(self.config)
  20. def test_spm_create_update_repo(self):
  21. '''
  22. test spm create_repo
  23. '''
  24. self._spm_create_update_repo(self.config)
  25. self.assertTrue(os.path.exists(self.config['spm_db']))
  26. l_repo_file = os.path.join(self.config['spm_cache_dir'], 'local_repo.p')
  27. self.assertTrue(os.path.exists(l_repo_file))
  28. def tearDown(self):
  29. shutil.rmtree(self._tmp_spm)