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.

34 line
1.3KB

  1. import pytest
  2. from dds_ci import dds
  3. from dds_ci.testing.fixtures import DDSWrapper, Project
  4. from dds_ci.testing.error import expect_error_marker
  5. from pathlib import Path
  6. @pytest.fixture()
  7. def tmp_repo(tmp_path: Path, dds: DDSWrapper) -> Path:
  8. dds.run(['repoman', 'init', tmp_path])
  9. return tmp_path
  10. def test_bad_pkg_id(dds: DDSWrapper, tmp_repo: Path) -> None:
  11. with expect_error_marker('invalid-pkg-id-str-version'):
  12. dds.run(['repoman', 'add', tmp_repo, 'foo@bar', 'http://example.com'])
  13. with expect_error_marker('invalid-pkg-id-str'):
  14. dds.run(['repoman', 'add', tmp_repo, 'foo', 'http://example.com'])
  15. def test_add_simple(dds: DDSWrapper, tmp_repo: Path) -> None:
  16. dds.run(['repoman', 'add', tmp_repo, 'neo-fun@0.6.0', 'git+https://github.com/vector-of-bool/neo-fun.git#0.6.0'])
  17. with expect_error_marker('dup-pkg-add'):
  18. dds.run(
  19. ['repoman', 'add', tmp_repo, 'neo-fun@0.6.0', 'git+https://github.com/vector-of-bool/neo-fun.git#0.6.0'])
  20. def test_add_github(dds: DDSWrapper, tmp_repo: Path) -> None:
  21. dds.run(['repoman', 'add', tmp_repo, 'neo-fun@0.6.0', 'github:vector-of-bool/neo-fun#0.6.0'])
  22. with expect_error_marker('dup-pkg-add'):
  23. dds.run(['repoman', 'add', tmp_repo, 'neo-fun@0.6.0', 'github:vector-of-bool/neo-fun#0.6.0'])