Skip to content

Commit 5497184

Browse files
committed
update tests to pass
1 parent 84dff8d commit 5497184

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

lib/idp_common_pkg/idp_common/config/models.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,6 @@ def parse_int(cls, v: Any) -> int:
133133
return int(v) if v else 0
134134
return int(v)
135135

136-
@model_validator(mode="after")
137-
def model_validator(self) -> Self:
138-
if not self.agentic.review_agent_model:
139-
self.agentic.review_agent_model = self.model
140-
141-
return self
142-
143136
@model_validator(mode="after")
144137
def set_default_review_agent_model(self) -> Self:
145138
"""Set review_agent_model to extraction model if not specified."""

lib/idp_common_pkg/tests/unit/classification/test_classification_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ def test_classify_page_bedrock_success(
291291

292292
# Verify calls
293293
mock_get_text.assert_called_once_with("s3://bucket/text.txt")
294-
mock_prepare_image.assert_called_once_with("s3://bucket/image.jpg", None, None)
294+
# ImageConfig defaults to 1200x1200 when not explicitly configured
295+
mock_prepare_image.assert_called_once_with("s3://bucket/image.jpg", 1200, 1200)
295296
mock_prepare_bedrock_image.assert_called_once_with(b"image_data")
296297
mock_invoke.assert_called_once()
297298

lib/idp_common_pkg/tests/unit/ocr/test_ocr_service.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ def test_init_textract_backend_default(self):
106106
assert service.max_workers == 20
107107
assert service.dpi is None # Default is None
108108
assert service.enhanced_features is False
109-
# Default image sizing
109+
# Default image sizing (from ImageConfig defaults)
110110
assert service.resize_config == {
111-
"target_width": 951,
112-
"target_height": 1268,
111+
"target_width": 1200,
112+
"target_height": 1200,
113113
}
114114
assert service.preprocessing_config is None
115115

@@ -198,10 +198,10 @@ def test_init_config_pattern_default_sizing(self):
198198
with patch("boto3.client"):
199199
service = OcrService(config=config)
200200

201-
# Verify defaults are applied
201+
# Verify defaults are applied (from ImageConfig model defaults)
202202
assert service.resize_config == {
203-
"target_width": 951,
204-
"target_height": 1268,
203+
"target_width": 1200,
204+
"target_height": 1200,
205205
}
206206
assert service.dpi == 200
207207

@@ -242,7 +242,8 @@ def test_init_config_pattern_empty_strings_apply_defaults(self):
242242
with patch("boto3.client"):
243243
service = OcrService(config=config)
244244

245-
# Verify defaults are applied (empty strings treated same as None)
245+
# Verify OCR service defaults are applied (empty strings treated same as None)
246+
# Note: Empty strings bypass Pydantic defaults, triggering OCR service defaults
246247
assert service.resize_config == {
247248
"target_width": 951,
248249
"target_height": 1268,

0 commit comments

Comments
 (0)