Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, config: AgentConfig | None = None) -> None:
"""Initialize the agent with optional config."""
self.config = config or AgentConfig()

@require_non_blank_strings("name")
@require_non_blank_strings("name", use_partial_bind=False)
def run(self, name: str) -> str:
"""Return a greeting for the provided name."""
return f"{self.config.greeting}, {name}!"
7 changes: 7 additions & 0 deletions agents/agent1/tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ def test_run_requires_name() -> None:
agent.run("")


def test_run_raises_type_error_when_name_omitted() -> None:
"""Agent raises TypeError when name argument is not provided."""
agent = ExampleAgent()
with pytest.raises(TypeError):
agent.run() # type: ignore[call-arg]


def test_run_rejects_whitespace_only_name() -> None:
"""Agent validates whitespace-only names via decorator guard."""
agent = ExampleAgent()
Expand Down
Loading