Skip to content

Commit f6d99a2

Browse files
Update tests/server/test_id_generator.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent b1bdd89 commit f6d99a2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/server/test_id_generator.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ def test_context_mutability(self):
3434
assert context.task_id == "task_456"
3535

3636
def test_context_validation(self):
37-
"""Test that context validates field types."""
38-
context = IDGeneratorContext(task_id="valid_string")
39-
assert isinstance(context.task_id, str)
37+
"""Test that context raises validation error for invalid types."""
38+
from pydantic import ValidationError
39+
40+
with pytest.raises(ValidationError):
41+
IDGeneratorContext(task_id={"not": "a string"})
4042

4143

4244
class TestIDGenerator:

0 commit comments

Comments
 (0)