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