|
11 | 11 |
|
12 | 12 | from __future__ import annotations |
13 | 13 |
|
14 | | -import json |
15 | | -from pathlib import Path |
16 | | - |
17 | 14 | import pytest |
18 | 15 |
|
19 | 16 | # ✅ CORRECT: Import from public API |
@@ -185,16 +182,12 @@ async def test_buyer_discovers_products_for_coffee_campaign(self, mocker): |
185 | 182 | "property_tags": ["morning", "lifestyle"], |
186 | 183 | } |
187 | 184 | ], |
188 | | - "pricing_options": [ |
189 | | - {"model": "cpm_fixed_rate", "is_fixed": True, "cpm": 4.50} |
190 | | - ], |
| 185 | + "pricing_options": [{"model": "cpm_fixed_rate", "is_fixed": True, "cpm": 4.50}], |
191 | 186 | } |
192 | 187 | ] |
193 | 188 | } |
194 | 189 |
|
195 | | - mock_result = TaskResult( |
196 | | - status=TaskStatus.COMPLETED, data=mock_response_data, success=True |
197 | | - ) |
| 190 | + mock_result = TaskResult(status=TaskStatus.COMPLETED, data=mock_response_data, success=True) |
198 | 191 |
|
199 | 192 | mocker.patch.object(client.adapter, "get_products", return_value=mock_result) |
200 | 193 |
|
@@ -227,9 +220,7 @@ async def test_buyer_handles_no_products_available(self, mocker): |
227 | 220 | client = ADCPClient(config) |
228 | 221 |
|
229 | 222 | # Mock empty response |
230 | | - mock_result = TaskResult( |
231 | | - status=TaskStatus.COMPLETED, data={"products": []}, success=True |
232 | | - ) |
| 223 | + mock_result = TaskResult(status=TaskStatus.COMPLETED, data={"products": []}, success=True) |
233 | 224 |
|
234 | 225 | mocker.patch.object(client.adapter, "get_products", return_value=mock_result) |
235 | 226 |
|
@@ -309,11 +300,7 @@ async def test_create_media_buy_handles_error_response(self, mocker): |
309 | 300 | # Mock error response |
310 | 301 | mock_result = TaskResult( |
311 | 302 | status=TaskStatus.COMPLETED, |
312 | | - data={ |
313 | | - "errors": [ |
314 | | - {"code": "budget_exceeded", "message": "Budget exceeds limit"} |
315 | | - ] |
316 | | - }, |
| 303 | + data={"errors": [{"code": "budget_exceeded", "message": "Budget exceeds limit"}]}, |
317 | 304 | success=True, # Note: Protocol success, but logical error |
318 | 305 | ) |
319 | 306 |
|
@@ -425,9 +412,7 @@ def test_anti_pattern_importing_generated_poc(self): |
425 | 412 | "property_ids": ["site1"], |
426 | 413 | } |
427 | 414 | ], |
428 | | - "pricing_options": [ |
429 | | - {"model": "cpm_fixed_rate", "is_fixed": True, "cpm": 5.0} |
430 | | - ], |
| 415 | + "pricing_options": [{"model": "cpm_fixed_rate", "is_fixed": True, "cpm": 5.0}], |
431 | 416 | } |
432 | 417 |
|
433 | 418 | product = Product.model_validate(product_json) |
@@ -525,9 +510,7 @@ def sample_product_json(): |
525 | 510 | "property_ids": ["homepage", "mobile_app"], |
526 | 511 | } |
527 | 512 | ], |
528 | | - "pricing_options": [ |
529 | | - {"model": "cpm_fixed_rate", "is_fixed": True, "cpm": 5.50} |
530 | | - ], |
| 513 | + "pricing_options": [{"model": "cpm_fixed_rate", "is_fixed": True, "cpm": 5.50}], |
531 | 514 | } |
532 | 515 |
|
533 | 516 |
|
|
0 commit comments