(
ad_id: str,
score: float,
*,
sensitive: bool = False,
age_restricted: bool = False,
blocked_keywords: list[str] | None = None,
advertiser_id: str = "adv-1",
)
| 8 | |
| 9 | |
| 10 | def _make_hit( |
| 11 | ad_id: str, |
| 12 | score: float, |
| 13 | *, |
| 14 | sensitive: bool = False, |
| 15 | age_restricted: bool = False, |
| 16 | blocked_keywords: list[str] | None = None, |
| 17 | advertiser_id: str = "adv-1", |
| 18 | ) -> VectorHit: |
| 19 | return VectorHit( |
| 20 | ad_id=ad_id, |
| 21 | advertiser_id=advertiser_id, |
| 22 | score=score, |
| 23 | payload={ |
| 24 | "ad_id": ad_id, |
| 25 | "advertiser_id": advertiser_id, |
| 26 | "title": f"Title {ad_id}", |
| 27 | "body": f"Body {ad_id}", |
| 28 | "cta_text": "Click", |
| 29 | "landing_url": f"https://example.com/{ad_id}", |
| 30 | "topics": ["tech"], |
| 31 | "locale": ["en-US"], |
| 32 | "verticals": ["technology"], |
| 33 | "blocked_keywords": blocked_keywords or [], |
| 34 | "sensitive": sensitive, |
| 35 | "age_restricted": age_restricted, |
| 36 | }, |
| 37 | ) |
| 38 | |
| 39 | |
| 40 | class TestPolicySensitiveGating: |
no test coverage detected