Add project tools and strict provider execution

This commit is contained in:
rob
2026-07-20 22:27:36 -03:00
parent c289e812fb
commit 6a88fe2e0f
19 changed files with 1504 additions and 84 deletions
+36
View File
@@ -105,6 +105,25 @@ class TestToolArgument:
with pytest.raises(ValueError):
ToolArgument(flag="--value", variable="value", **values)
@pytest.mark.parametrize(
("legacy_type", "canonical_type"),
[
("str", "string"),
("int", "integer"),
("float", "number"),
("bool", "boolean"),
],
)
def test_legacy_scalar_type_aliases_are_normalized(
self, legacy_type, canonical_type
):
argument = ToolArgument(
flag="--value", variable="value", type=legacy_type
)
assert argument.type == canonical_type
assert argument.to_dict().get("type", "string") == canonical_type
class TestPromptStep:
"""Tests for PromptStep dataclass."""
@@ -686,6 +705,23 @@ class TestAgentContext:
restored = PromptStep.from_dict(step.to_dict())
assert restored.skills == ["python"]
def test_promptstep_deny_fallback_roundtrip(self):
step = PromptStep(
prompt="Private", provider="local", output_var="out",
fallback_policy="deny",
)
restored = PromptStep.from_dict(step.to_dict())
assert restored.fallback_policy == "deny"
def test_promptstep_rejects_invalid_fallback_policy(self):
with pytest.raises(ValueError, match="fallback_policy"):
PromptStep(
prompt="Test", provider="local", output_var="out",
fallback_policy="sometimes",
)
class TestDeprecationFields:
def test_round_trip_and_warning(self):