Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

32 lines
1.0KB

  1. import pytest
  2. from dds_ci.testing import ProjectOpener, Project
  3. @pytest.fixture()
  4. def test_project(project_opener: ProjectOpener) -> Project:
  5. return project_opener.open('projects/sdist')
  6. def test_create_sdist(test_project: Project) -> None:
  7. test_project.sdist_create()
  8. sd_dir = test_project.build_root / 'foo@1.2.3.tar.gz'
  9. assert sd_dir.is_file()
  10. def test_export_sdist(test_project: Project) -> None:
  11. test_project.sdist_export()
  12. assert (test_project.dds.repo_dir / 'foo@1.2.3').is_dir()
  13. def test_import_sdist_archive(test_project: Project) -> None:
  14. repo_content_path = test_project.dds.repo_dir / 'foo@1.2.3'
  15. assert not repo_content_path.is_dir()
  16. test_project.sdist_create()
  17. assert not repo_content_path.is_dir()
  18. test_project.dds.repo_import(test_project.build_root / 'foo@1.2.3.tar.gz')
  19. assert repo_content_path.is_dir()
  20. assert repo_content_path.joinpath('library.jsonc').is_file()
  21. # Excluded file will not be in the sdist:
  22. assert not repo_content_path.joinpath('other-file.txt').is_file()