Topics: ad.topics intersects request.topics (ANY).
| 15 | |
| 16 | |
| 17 | class TestTopicsSemantics: |
| 18 | """Topics: ad.topics intersects request.topics (ANY).""" |
| 19 | |
| 20 | def test_topics_intersection_any(self): |
| 21 | # Rule: ad passes iff at least one topic in common |
| 22 | request_topics = ["python", "ai"] |
| 23 | ad_topics_intersects = ["python", "other"] # "python" in common -> pass |
| 24 | ad_topics_no_intersect = ["java", "c++"] # no common -> fail |
| 25 | assert set(ad_topics_intersects) & set(request_topics) == {"python"} |
| 26 | assert set(ad_topics_no_intersect) & set(request_topics) == set() |
| 27 | # Lock the rule constant |
| 28 | assert "ANY" in RULE_TOPICS_INTERSECT |
| 29 | |
| 30 | |
| 31 | class TestVerticalsSemantics: |
nothing calls this directly
no outgoing calls
no test coverage detected