Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import json
  2. from contextlib import contextmanager
  3. from tests import dds, DDS
  4. from tests.fileutil import ensure_dir
  5. import pytest
  6. def load_catalog(dds: DDS, data):
  7. dds.scope.enter_context(ensure_dir(dds.build_dir))
  8. dds.catalog_create()
  9. json_path = dds.build_dir / 'catalog.json'
  10. dds.scope.enter_context(
  11. dds.set_contents(json_path,
  12. json.dumps(data).encode()))
  13. dds.catalog_import(json_path)
  14. def test_get(dds: DDS):
  15. load_catalog(
  16. dds, {
  17. 'version': 2,
  18. 'packages': {
  19. 'neo-sqlite3': {
  20. '0.3.0': {
  21. 'url':
  22. 'git+https://github.com/vector-of-bool/neo-sqlite3.git#0.3.0',
  23. },
  24. },
  25. },
  26. })
  27. dds.catalog_get('neo-sqlite3@0.3.0')
  28. assert (dds.scratch_dir / 'neo-sqlite3@0.3.0').is_dir()
  29. assert (dds.scratch_dir / 'neo-sqlite3@0.3.0/package.jsonc').is_file()
  30. def test_get_http(dds: DDS):
  31. load_catalog(
  32. dds, {
  33. 'version': 2,
  34. 'packages': {
  35. 'cmcstl2': {
  36. '2020.2.24': {
  37. 'url':
  38. 'https://github.com/CaseyCarter/cmcstl2/archive/684a96d527e4dc733897255c0177b784dc280980.tar.gz?dds_lm=cmc/stl2;',
  39. },
  40. },
  41. },
  42. })
  43. dds.catalog_get('cmcstl2@2020.2.24')
  44. assert dds.scratch_dir.joinpath('cmcstl2@2020.2.24/include').is_dir()