Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mardiros_fastlife /tests /unittests /app /test_i18n.py
| import pytest | |
| from fastapi import FastAPI | |
| from fastapi.testclient import TestClient | |
| from fastlife.testing import WebTestClient | |
| def apiclient(app: FastAPI): | |
| return TestClient(app) | |
| def test_hello_i18n(client: WebTestClient): | |
| resp = client.get("/fr/hello") | |
| assert resp.html.h1.text == "Salut tout le monde !" | |
| assert resp.html.by_text("Souviens toi que t'as qu'une seule vie.") | |
| link = resp.html.by_text("Voir plus..") | |
| assert link is not None | |
| assert link.attrs["href"] == "/fr/dummy-messages" | |
| def test_i18n_helpers(apiclient: TestClient): | |
| resp = apiclient.get("/fr/dummy-messages") | |
| assert resp.json() == { | |
| "__call__": "Le renard marron rapide saute par dessus chient flemmard", | |
| "dgettext": "addresse email invalide", | |
| "dngettext_0": "0 entrée dans addresse email", | |
| "dngettext_1": "1 entrée dans addresse email", | |
| "dngettext_2": "2 entrées dans addresse email", | |
| "dnpgettext_0": "0 balls in addresse email", | |
| "dnpgettext_1": "1 ball in addresse email", | |
| "dnpgettext_2": "2 balls in addresse email", | |
| "dpgettext_1": "addresse email (*)", | |
| "dpgettext_2": "addresse email est requis", | |
| "gettext": "Le renard marron rapide saute par dessus chient flemmard", | |
| "ngettext_0": "Le renard marron rapide saute par dessus le chient flemmard", | |
| "ngettext_1": "Le renard marron rapide saute par dessus le chient flemmard", | |
| "ngettext_2": "Les 2 renards marron rapides sautent par dessus " | |
| "le chient flemmard", | |
| "pgettext_0": "pêcher", | |
| "pgettext_1": "poisson", | |
| "npgettext_0": "0 crayon", | |
| "npgettext_1": "1 crayon", | |
| "npgettext_2": "2 crayons", | |
| } | |
Xet Storage Details
- Size:
- 1.74 kB
- Xet hash:
- d2de5df9416d9945f04cc6c4f0ab0edc20e8827594d697440f88f39ab592282e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.