from services.rpg_locale import infer_rp_language, locale_instruction


def test_infer_ru_from_cyrillic_chat():
    msgs = [
        {"role": "user", "content": "Привет, как дела?"},
        {"role": "assistant", "content": "Нормально, идём дальше."},
    ]
    assert infer_rp_language(msgs) == "ru"


def test_infer_en_from_latin_chat():
    msgs = [
        {"role": "user", "content": "Hello, how are you?"},
        {"role": "assistant", "content": "Fine, let's continue."},
    ]
    assert infer_rp_language(msgs) == "en"


def test_locale_instruction_ru():
    assert "Russian" in locale_instruction("ru")
    assert "MUST be in Russian" in locale_instruction("ru")
