MCPcopy
hub / github.com/authlib/authlib / test_userinfo_validate_locale

Function test_userinfo_validate_locale

tests/core/test_oidc/test_core.py:177–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176
177def test_userinfo_validate_locale():
178 UserInfo({"sub": "1"}).validate_locale()
179 UserInfo({"sub": "1", "locale": "en"}).validate_locale()
180 UserInfo({"sub": "1", "locale": "en-US"}).validate_locale()
181 UserInfo({"sub": "1", "locale": "zh-Hans-CN"}).validate_locale()
182 UserInfo({"sub": "1", "locale": "x-custom"}).validate_locale()
183
184 with pytest.raises(ValueError, match="BCP 47"):
185 UserInfo({"sub": "1", "locale": "fr_FR"}).validate_locale()
186
187 with pytest.raises(ValueError, match="BCP 47"):
188 UserInfo({"sub": "1", "locale": "toolongsubtag"}).validate_locale()

Callers

nothing calls this directly

Calls 2

UserInfoClass · 0.90
validate_localeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…