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

@@ -17,11 +17,17 @@ from libbot.i18n import sync
("nested", ["callbacks", "default"], "uk", "авжеж"),
],
)
def test_i18n_get(key: str, args: List[str], locale: Union[str, None], expected: Any):
def test_i18n_get(
key: str,
args: List[str],
locale: Union[str, None],
expected: Any,
location_locale: Path,
):
assert (
sync._(key, *args, locale=locale, locales_root=Path("tests/data/locale"))
sync._(key, *args, locale=locale, locales_root=location_locale)
if locale is not None
else sync._(key, *args, locales_root=Path("tests/data/locale"))
else sync._(key, *args, locales_root=location_locale)
) == expected
@@ -33,10 +39,10 @@ def test_i18n_get(key: str, args: List[str], locale: Union[str, None], expected:
("nested", ["callbacks", "default"], ["sure", "авжеж"]),
],
)
def test_i18n_in_all_locales(key: str, args: List[str], expected: Any):
assert (
sync.in_all_locales(key, *args, locales_root=Path("tests/data/locale"))
) == expected
def test_i18n_in_all_locales(
key: str, args: List[str], expected: Any, location_locale: Path
):
assert (sync.in_all_locales(key, *args, locales_root=location_locale)) == expected
@pytest.mark.parametrize(
@@ -47,7 +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):
assert (
sync.in_every_locale(key, *args, locales_root=Path("tests/data/locale"))
) == expected
def test_i18n_in_every_locale(
key: str, args: List[str], expected: Any, location_locale: Path
):
assert (sync.in_every_locale(key, *args, locales_root=location_locale)) == expected