Updated to 0.2.1
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user