Updated to 0.2.1
This commit is contained in:
@@ -19,12 +19,16 @@ from libbot import i18n
|
||||
],
|
||||
)
|
||||
async def test_i18n_get(
|
||||
key: str, args: List[str], locale: Union[str, None], expected: Any
|
||||
key: str,
|
||||
args: List[str],
|
||||
locale: Union[str, None],
|
||||
expected: Any,
|
||||
location_locale: Path,
|
||||
):
|
||||
assert (
|
||||
await i18n._(key, *args, locale=locale, locales_root=Path("tests/data/locale"))
|
||||
await i18n._(key, *args, locale=locale, locales_root=location_locale)
|
||||
if locale is not None
|
||||
else await i18n._(key, *args, locales_root=Path("tests/data/locale"))
|
||||
else await i18n._(key, *args, locales_root=location_locale)
|
||||
) == expected
|
||||
|
||||
|
||||
@@ -37,9 +41,11 @@ async def test_i18n_get(
|
||||
("nested", ["callbacks", "default"], ["sure", "авжеж"]),
|
||||
],
|
||||
)
|
||||
async def test_i18n_in_all_locales(key: str, args: List[str], expected: Any):
|
||||
async def test_i18n_in_all_locales(
|
||||
key: str, args: List[str], expected: Any, location_locale: Path
|
||||
):
|
||||
assert (
|
||||
await i18n.in_all_locales(key, *args, locales_root=Path("tests/data/locale"))
|
||||
await i18n.in_all_locales(key, *args, locales_root=location_locale)
|
||||
) == expected
|
||||
|
||||
|
||||
@@ -52,7 +58,9 @@ async def test_i18n_in_all_locales(key: str, args: List[str], expected: Any):
|
||||
("nested", ["callbacks", "default"], {"en": "sure", "uk": "авжеж"}),
|
||||
],
|
||||
)
|
||||
async def test_i18n_in_every_locale(key: str, args: List[str], expected: Any):
|
||||
async def test_i18n_in_every_locale(
|
||||
key: str, args: List[str], expected: Any, location_locale: Path
|
||||
):
|
||||
assert (
|
||||
await i18n.in_every_locale(key, *args, locales_root=Path("tests/data/locale"))
|
||||
await i18n.in_every_locale(key, *args, locales_root=location_locale)
|
||||
) == expected
|
||||
|
Reference in New Issue
Block a user