mirror of
https://github.com/aclist/dztui.git
synced 2026-11-12 13:00:37 +01:00
chore: typehint tests
This commit is contained in:
1 parent
a5374d1f1a
commit
e29433b388
23 files changed
+170
-93
No files matched your search
@@ -1,27 +1,32 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.util import localize
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
|
||||
def test_de(monkeypatch):
|
||||
|
||||
def test_de(monkeypatch: "MonkeyPatch") -> None:
|
||||
monkeypatch.setenv("LC_ALL", "de_DE.UTF-8")
|
||||
localize.set_locale()
|
||||
assert localize.number(9900) == "9.900"
|
||||
assert localize.number(99.88) == "99,88"
|
||||
|
||||
|
||||
def test_en(monkeypatch):
|
||||
def test_en(monkeypatch: "MonkeyPatch") -> None:
|
||||
monkeypatch.setenv("LC_ALL", "en_US.UTF-8")
|
||||
localize.set_locale()
|
||||
assert localize.number(9900) == "9,900"
|
||||
assert localize.number(99.88) == "99.88"
|
||||
|
||||
|
||||
def test_none(monkeypatch):
|
||||
def test_none(monkeypatch: "MonkeyPatch") -> None:
|
||||
localize.set_locale()
|
||||
assert localize.number(9900) == "9,900"
|
||||
assert localize.number(99.88) == "99.88"
|
||||
|
||||
|
||||
def test_empty(monkeypatch):
|
||||
def test_empty(monkeypatch: "MonkeyPatch") -> None:
|
||||
monkeypatch.setenv("LC_ALL", "")
|
||||
localize.set_locale()
|
||||
assert localize.number(9900) == "9,900"
|
||||
|
||||
Reference in new issue
Block a user