MCPcopy Create free account
hub / github.com/Exorust/Adkit-MCP / TestLocaleSemantics

Class TestLocaleSemantics

tests/test_match_semantics.py:43–60  ·  view source on GitHub ↗

Locale: exact match, or empty/[''] as global.

Source from the content-addressed store, hash-verified

41
42
43class TestLocaleSemantics:
44 """Locale: exact match, or empty/[''] as global."""
45
46 def test_locale_exact_match(self):
47 request_locale = "en-US"
48 ad_locale_match = ["en-US"]
49 ad_locale_global = [""]
50 ad_locale_global_empty = []
51 # Match: ad has exact
52 assert request_locale in ad_locale_match
53 # Match: ad is global ("" or [])
54 assert "" in ad_locale_global or ad_locale_global_empty == []
55 assert "exact" in RULE_LOCALE_EXACT_OR_GLOBAL or "global" in RULE_LOCALE_EXACT_OR_GLOBAL
56
57 def test_no_request_locale_means_no_filter(self):
58 request_locale = None
59 # When request has no locale, we don't add a locale filter
60 assert request_locale is None
61
62
63class TestExclusionsSemantics:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected