test_repo.py 945 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. @pytest.mark.destructive_test
  11. @pytest.mark.windows_whitelisted
  12. class SPMRepoTest(SPMCase):
  13. """
  14. Validate commands related to spm repo
  15. """
  16. def setUp(self):
  17. self.config = self._spm_config()
  18. self._spm_build_files(self.config)
  19. @pytest.mark.slow_test(seconds=1) # Test takes >0.1 and <=1 seconds
  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)