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.

12345678910111213141516171819202122232425262728293031323334353637
  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.3.0': {
  14. 'git': {
  15. 'url':
  16. 'https://github.com/vector-of-bool/neo-sqlite3.git',
  17. 'ref':
  18. '0.3.0',
  19. },
  20. },
  21. },
  22. },
  23. }
  24. dds.scope.enter_context(
  25. dds.set_contents(json_path,
  26. json.dumps(import_data).encode()))
  27. dds.catalog_import(json_path)
  28. dds.catalog_get('neo-sqlite3@0.3.0')
  29. assert (dds.source_root / 'neo-sqlite3@0.3.0').is_dir()
  30. assert (dds.source_root / 'neo-sqlite3@0.3.0/package.jsonc').is_file()