Updated to 0.2.1
Some checks failed
Tests / test (3.10) (push) Failing after 55s
Tests / test (3.11) (push) Failing after 5s
Tests / test (3.8) (push) Failing after 6s
Tests / test (3.9) (push) Failing after 5s

This commit is contained in:
2023-08-06 19:11:16 +02:00
parent 461642a529
commit 64aa2686ea
24 changed files with 176 additions and 69 deletions

View File

@@ -5,8 +5,6 @@ import pytest
from libbot.i18n import BotLocale
bot_locale = BotLocale(Path("tests/data/locale"))
@pytest.mark.parametrize(
"key, args, locale, expected",
@@ -20,7 +18,11 @@ bot_locale = BotLocale(Path("tests/data/locale"))
],
)
def test_bot_locale_get(
key: str, args: List[str], locale: Union[str, None], expected: Any
key: str,
args: List[str],
locale: Union[str, None],
expected: Any,
bot_locale: BotLocale,
):
assert (
bot_locale._(key, *args, locale=locale)
@@ -37,7 +39,9 @@ def test_bot_locale_get(
("nested", ["callbacks", "default"], ["sure", "авжеж"]),
],
)
def test_i18n_in_all_locales(key: str, args: List[str], expected: Any):
def test_i18n_in_all_locales(
key: str, args: List[str], expected: Any, bot_locale: BotLocale
):
assert (bot_locale.in_all_locales(key, *args)) == expected
@@ -49,5 +53,7 @@ def test_i18n_in_all_locales(key: str, args: List[str], expected: Any):
("nested", ["callbacks", "default"], {"en": "sure", "uk": "авжеж"}),
],
)
def test_i18n_in_every_locale(key: str, args: List[str], expected: Any):
def test_i18n_in_every_locale(
key: str, args: List[str], expected: Any, bot_locale: BotLocale
):
assert (bot_locale.in_every_locale(key, *args)) == expected