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

@@ -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