mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 03:00:23 +00:00
fix(tests): update hardcoded locale counts for Italian (it)
6 test files had hardcoded locale counts/lists that broke when
the Italian locale block was added:
- test_issue1488_composer_voice_buttons.py: added 'it' to LOCALES,
replaced assert count == 9 with len(self.LOCALES)
- test_issue1560_password_env_var_lock.py: added 'it' to LOCALES
- test_1560_password_env_var_no_op.py: added 'it' to EXPECTED_LOCALES
- test_login_locale_parity.py: bumped floor from 9 to 10, added 'it'
- test_stage268_opus_followups.py: bumped floor from 9 to 10
(cherry picked from commit f5e42cec9b)
This commit is contained in:
committed by
nesquena-hermes
parent
ba3cc2c541
commit
23a2ad818f
@@ -333,7 +333,7 @@ def test_panels_js_uses_locked_placeholder_i18n_key():
|
||||
# (en/es/de/zh/zh-Hant/ru/ja/fr/pt). The repo currently ships 9 locales but
|
||||
# substitutes 'ko' for 'fr' — we test what the repo actually has, not what the
|
||||
# issue body lists, so a future addition of fr won't fail the suite either.
|
||||
EXPECTED_LOCALES = ("en", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko")
|
||||
EXPECTED_LOCALES = ("en", "it", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko")
|
||||
|
||||
|
||||
def _locale_block(locale_key: str) -> str:
|
||||
|
||||
@@ -123,7 +123,7 @@ class TestComposerVoiceButtonI18n:
|
||||
"voice_mode_toggle_active",
|
||||
)
|
||||
|
||||
LOCALES = ("en", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko")
|
||||
LOCALES = ("en", "it", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko")
|
||||
|
||||
def test_legacy_voice_toggle_key_removed(self):
|
||||
"""The old key whose string was 'Voice input' caused the duplicate-
|
||||
@@ -212,9 +212,9 @@ class TestVoiceModePreferenceGate:
|
||||
src = _src("i18n.js")
|
||||
for key in ("settings_label_voice_mode", "settings_desc_voice_mode"):
|
||||
count = len(re.findall(rf'\b{re.escape(key)}\s*:', src))
|
||||
assert count == 9, (
|
||||
assert count == len(self.LOCALES), (
|
||||
f"Preferences i18n key {key!r} appears {count} times — "
|
||||
f"expected 9 (one per locale)."
|
||||
f"expected {len(self.LOCALES)} (one per locale)."
|
||||
)
|
||||
|
||||
def test_panels_js_wires_voice_mode_pref(self):
|
||||
|
||||
@@ -104,10 +104,10 @@ def test_panels_js_hides_disable_auth_button_when_env_locked():
|
||||
'Disable Auth button must be hidden in the env-locked code path'
|
||||
|
||||
|
||||
# ── i18n: keys present in all 9 locales (static/i18n.js) ──────────────────
|
||||
# ── i18n: keys present in all 10 locales (static/i18n.js) ──────────────────
|
||||
|
||||
|
||||
LOCALES = ['en', 'ja', 'ru', 'es', 'de', 'zh', 'zh-Hant', 'pt', 'ko']
|
||||
LOCALES = ['en', 'it', 'ja', 'ru', 'es', 'de', 'zh', 'zh-Hant', 'pt', 'ko']
|
||||
|
||||
|
||||
def _split_locales(i18n_src):
|
||||
|
||||
@@ -260,10 +260,10 @@ def test_every_i18n_locale_has_login_locale_entry():
|
||||
|
||||
|
||||
def test_login_locale_count_matches_or_exceeds_floor():
|
||||
"""_LOGIN_LOCALE must contain at least the 9 launch locales (en, es, de, ru, zh, zh-Hant, ja, pt, ko)."""
|
||||
"""_LOGIN_LOCALE must contain at least the 10 launch locales (en, it, es, de, ru, zh, zh-Hant, ja, pt, ko)."""
|
||||
login = _load_login_locale()
|
||||
assert len(login) >= 9, f"_LOGIN_LOCALE shrank: only {len(login)} entries"
|
||||
for k in ("en", "es", "de", "ru", "zh", "zh-Hant", "ja", "pt", "ko"):
|
||||
assert len(login) >= 10, f"_LOGIN_LOCALE shrank: only {len(login)} entries"
|
||||
for k in ("en", "it", "es", "de", "ru", "zh", "zh-Hant", "ja", "pt", "ko"):
|
||||
assert k in login, f"_LOGIN_LOCALE missing core locale {k!r}"
|
||||
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ def test_sf1_session_meta_children_present_in_all_locales():
|
||||
f"session_meta_messages appears {msg_count} times but "
|
||||
f"session_meta_children appears {child_count} — must be in every locale"
|
||||
)
|
||||
# Sanity: 9 known locales (en, ja, ru, es, de, zh, zh-Hant, plus the legacy zh-tw/zh-hk aliases)
|
||||
assert child_count >= 9, f"expected >=9 locales with session_meta_children, got {child_count}"
|
||||
# Sanity: 10 known locales (en, it, ja, ru, es, de, zh, zh-Hant, plus the legacy zh-tw/zh-hk aliases)
|
||||
assert child_count >= 10, f"expected >=10 locales with session_meta_children, got {child_count}"
|
||||
|
||||
|
||||
# --- SF-2 (#1462): duplicate carries per-session settings ---
|
||||
|
||||
Reference in New Issue
Block a user