From 8c1940445503fd6678d0961600f2be81622793a2 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Tue, 24 Feb 2026 17:26:15 -0500 Subject: Extensive use of type checking. Movement of pytest conf towards handling managers (for db agnostic unittest). Starting to organize pytests. --- jb/models/event.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'jb/models/event.py') diff --git a/jb/models/event.py b/jb/models/event.py index c357772..c167420 100644 --- a/jb/models/event.py +++ b/jb/models/event.py @@ -11,13 +11,22 @@ class MTurkEvent(BaseModel): What AWS SNS will POST to our mturk_notifications endpoint (inside the request body) """ - event_type: EventTypeType = Field(example="AssignmentSubmitted") - event_timestamp: AwareDatetimeISO = Field(example="2025-10-16T18:45:51Z") - amt_hit_id: AMTBoto3ID = Field(example="12345678901234567890") + event_type: EventTypeType = Field( + json_schema_extra={"example": "AssignmentSubmitted"} + ) + event_timestamp: AwareDatetimeISO = Field( + json_schema_extra={"example": "2025-10-16T18:45:51Z"} + ) + amt_hit_id: AMTBoto3ID = Field( + json_schema_extra={"example": "12345678901234567890"} + ) amt_assignment_id: str = Field( - max_length=64, example="1234567890123456789012345678901234567890" + max_length=64, + json_schema_extra={"example": "1234567890123456789012345678901234567890"}, + ) + amt_hit_type_id: AMTBoto3ID = Field( + json_schema_extra={"example": "09876543210987654321"} ) - amt_hit_type_id: AMTBoto3ID = Field(example="09876543210987654321") @classmethod def from_sns(cls, data: Dict): -- cgit v1.2.3