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.

39 lines
1012B

  1. import json
  2. from tests import dds, DDS
  3. from tests.fileutil import ensure_dir
  4. import pytest
  5. def test_get(dds: DDS):
  6. dds.scope.enter_context(ensure_dir(dds.build_dir))
  7. dds.catalog_create()
  8. json_path = dds.build_dir / 'catalog.json'
  9. import_data = {
  10. 'version': 1,
  11. 'packages': {
  12. 'neo-sqlite3': {
  13. '0.2.2': {
  14. 'depends': {},
  15. 'git': {
  16. 'url':
  17. 'https://github.com/vector-of-bool/neo-sqlite3.git',
  18. 'ref':
  19. '0.2.2',
  20. },
  21. },
  22. },
  23. },
  24. }
  25. dds.scope.enter_context(
  26. dds.set_contents(json_path,
  27. json.dumps(import_data).encode()))
  28. dds.catalog_import(json_path)
  29. dds.catalog_get('neo-sqlite3@0.2.2')
  30. assert (dds.source_root / 'neo-sqlite3@0.2.2').is_dir()
  31. assert (dds.source_root / 'neo-sqlite3@0.2.2/package.dds').is_file()