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.

35 lines
949B

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