feat: dev tools

This commit is contained in:
2026-07-20 20:47:28 +02:00
parent a12229a147
commit cb2301d709
25 changed files with 614 additions and 7 deletions
+35
View File
@@ -0,0 +1,35 @@
import pytest
from pydantic import ValidationError
from agentci.config import Settings
def test_parses_comma_delimited_install_scripts() -> None:
settings = Settings(
_env_file=None, # type: ignore[call-arg]
install_scripts=" python, dotnet, company-tools, ",
)
assert settings.install_scripts == ["python", "dotnet", "company-tools"]
@pytest.mark.parametrize("value", ["../script", "tools/setup", "python,python"])
def test_rejects_unsafe_or_duplicate_install_scripts(value: str) -> None:
with pytest.raises(ValidationError):
Settings(_env_file=None, install_scripts=value) # type: ignore[call-arg]
def test_empty_install_scripts_disable_setup() -> None:
settings = Settings(
_env_file=None, # type: ignore[call-arg]
install_scripts="",
)
assert settings.install_scripts == []
def test_reads_comma_delimited_install_scripts_from_environment(monkeypatch) -> None:
monkeypatch.setenv("AGENTCI_INSTALL_SCRIPTS", "python,dotnet")
settings = Settings(_env_file=None) # type: ignore[call-arg]
assert settings.install_scripts == ["python", "dotnet"]