Whyx-PROmpTea / tests /test_i18n_parity.py
ArtShumov's picture
feat(prod): rewrite pipeline + NoobAI + ensemble tagger (3xWD14+DeepDanbooru-ready) + 1000 artists + negative templates + history ext + scoring config
e6404d0
Raw
History Blame
670 Bytes
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from src.i18n import L10N, t
def test_en_ru_key_parity():
en = set(L10N["en"].keys())
ru = set(L10N["ru"].keys())
assert en == ru, f"Key mismatch ENvsRU: only_en={en - ru}, only_ru={ru - en}"
def test_t_fallback_chain():
# Known key returns its value.
assert t("app_title", "en") == "Whyx-PROmpTea"
# Missing key in RU falls back to EN, then to the raw key.
assert t("app_title", "ru") == "Whyx-PROmpTea"
assert t("__not_a_real_key__", "ru") == "__not_a_real_key__"
assert t("__not_a_real_key__", "en") == "__not_a_real_key__"