mirror of
https://github.com/aclist/dztui.git
synced 2026-11-12 13:00:37 +01:00
chore: clear typehinting errors
This commit is contained in:
1 parent
3e7b49203a
commit
f7d95d5407
11 files changed
+99
-61
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.api.steam import find_user_id
|
||||
from dzgui.const.constants import DEFAULT_STEAM_PATH
|
||||
@@ -8,6 +9,9 @@ from tests.fixtures import fixture_path
|
||||
|
||||
pytestmark = pytest.mark.apitest
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"fixture, expect",
|
||||
@@ -19,12 +23,14 @@ pytestmark = pytest.mark.apitest
|
||||
("api/loginusers_beta_client_multiple_2.vdf", 0),
|
||||
],
|
||||
)
|
||||
def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
|
||||
def test_loginusers(monkeypatch: "MonkeyPatch", fixture: str, expect: int) -> None:
|
||||
def mock_loginusers(path: Path) -> Path:
|
||||
return fixture_path(fixture)
|
||||
|
||||
monkeypatch.setattr("dzgui.api.steam.find_loginusers", mock_loginusers)
|
||||
uid = find_user_id(Path(""))
|
||||
if uid is None:
|
||||
raise ValueError()
|
||||
assert int(uid) == expect
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user