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.

51 line
1.5KB

  1. import json
  2. from tests.fileutil import ensure_dir
  3. from tests import dds, DDS
  4. from tests.http import RepoFixture
  5. def test_get(dds: DDS, http_repo: RepoFixture):
  6. http_repo.import_json_data({
  7. 'version': 2,
  8. 'packages': {
  9. 'neo-sqlite3': {
  10. '0.3.0': {
  11. 'remote': {
  12. 'git': {
  13. 'url': 'https://github.com/vector-of-bool/neo-sqlite3.git',
  14. 'ref': '0.3.0',
  15. }
  16. }
  17. }
  18. }
  19. }
  20. })
  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):
  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()