You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.5KB

  1. from tests import DDS
  2. from tests.http import RepoFixture
  3. def test_build_deps_from_file(dds: DDS, http_repo: RepoFixture) -> None:
  4. assert not dds.deps_build_dir.is_dir()
  5. http_repo.import_json_file(dds.source_root / 'catalog.json')
  6. dds.repo_add(http_repo.url)
  7. dds.build_deps(['-d', dds.source_root / 'deps.json5'])
  8. assert (dds.deps_build_dir / 'neo-fun@0.3.0').is_dir()
  9. assert (dds.scratch_dir / 'INDEX.lmi').is_file()
  10. assert (dds.deps_build_dir / '_libman/neo-fun.lmp').is_file()
  11. assert (dds.deps_build_dir / '_libman/neo/fun.lml').is_file()
  12. def test_build_deps_from_cmd(dds: DDS, http_repo: RepoFixture) -> None:
  13. assert not dds.deps_build_dir.is_dir()
  14. http_repo.import_json_file(dds.source_root / 'catalog.json')
  15. dds.repo_add(http_repo.url)
  16. dds.build_deps(['neo-fun=0.3.0'])
  17. assert (dds.deps_build_dir / 'neo-fun@0.3.0').is_dir()
  18. assert (dds.scratch_dir / 'INDEX.lmi').is_file()
  19. assert (dds.deps_build_dir / '_libman/neo-fun.lmp').is_file()
  20. assert (dds.deps_build_dir / '_libman/neo/fun.lml').is_file()
  21. def test_multiple_deps(dds: DDS, http_repo: RepoFixture) -> None:
  22. assert not dds.deps_build_dir.is_dir()
  23. http_repo.import_json_file(dds.source_root / 'catalog.json')
  24. dds.repo_add(http_repo.url)
  25. dds.build_deps(['neo-fun^0.2.0', 'neo-fun~0.3.0'])
  26. assert (dds.deps_build_dir / 'neo-fun@0.3.0').is_dir()
  27. assert (dds.scratch_dir / 'INDEX.lmi').is_file()
  28. assert (dds.deps_build_dir / '_libman/neo-fun.lmp').is_file()
  29. assert (dds.deps_build_dir / '_libman/neo/fun.lml').is_file()