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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from tests.fileutil import ensure_dir
  2. from tests import DDS
  3. from tests.http import RepoFixture
  4. def test_get(dds: DDS, http_repo: RepoFixture) -> None:
  5. http_repo.import_json_data({
  6. 'version': 2,
  7. 'packages': {
  8. 'neo-sqlite3': {
  9. '0.3.0': {
  10. 'remote': {
  11. 'git': {
  12. 'url': 'https://github.com/vector-of-bool/neo-sqlite3.git',
  13. 'ref': '0.3.0',
  14. }
  15. }
  16. }
  17. }
  18. }
  19. })
  20. dds.scope.enter_context(ensure_dir(dds.source_root))
  21. dds.repo_add(http_repo.url)
  22. dds.catalog_get('neo-sqlite3@0.3.0')
  23. assert (dds.scratch_dir / 'neo-sqlite3@0.3.0').is_dir()
  24. assert (dds.scratch_dir / 'neo-sqlite3@0.3.0/package.jsonc').is_file()
  25. def test_get_http(dds: DDS, http_repo: RepoFixture) -> None:
  26. http_repo.import_json_data({
  27. 'packages': {
  28. 'cmcstl2': {
  29. '2020.2.24': {
  30. 'remote': {
  31. 'http': {
  32. 'url':
  33. 'https://github.com/CaseyCarter/cmcstl2/archive/684a96d527e4dc733897255c0177b784dc280980.tar.gz?dds_lm=cmc/stl2;',
  34. },
  35. 'auto-lib': 'cmc/stl2',
  36. }
  37. },
  38. },
  39. },
  40. })
  41. dds.scope.enter_context(ensure_dir(dds.source_root))
  42. dds.repo_add(http_repo.url)
  43. dds.catalog_get('cmcstl2@2020.2.24')
  44. assert dds.scratch_dir.joinpath('cmcstl2@2020.2.24/include').is_dir()