feat: add gitea agentic runtime control plane
This commit is contained in:
30
tests/unit/test_validator.py
Normal file
30
tests/unit/test_validator.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from engine.devops_agent.spec import load_workflow_spec
|
||||
from engine.devops_agent.validator import validate_workflow_spec
|
||||
|
||||
|
||||
def test_validate_accepts_the_sample_workflow() -> None:
|
||||
spec = load_workflow_spec(Path("workflows/gitea-issue-delivery.md"))
|
||||
|
||||
errors = validate_workflow_spec(spec)
|
||||
|
||||
assert errors == []
|
||||
|
||||
|
||||
def test_validate_rejects_write_permissions_without_safe_outputs() -> None:
|
||||
spec = load_workflow_spec(Path("tests/fixtures/specs/no_safe_outputs_for_write.md"))
|
||||
|
||||
errors = validate_workflow_spec(spec)
|
||||
|
||||
assert any("safe_outputs" in error for error in errors)
|
||||
|
||||
|
||||
def test_validate_rejects_invalid_path_scope() -> None:
|
||||
spec = load_workflow_spec(Path("tests/fixtures/specs/invalid_path_scope.md"))
|
||||
|
||||
errors = validate_workflow_spec(spec)
|
||||
|
||||
assert any("path_scope" in error for error in errors)
|
||||
Reference in New Issue
Block a user