test_repo.py 909 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # -*- coding: utf-8 -*-
  2. """
  3. Tests for the spm repo
  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. from tests.support.helpers import destructiveTest
  11. @destructiveTest
  12. @pytest.mark.windows_whitelisted
  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)