test(login): satisfy type and coverage gates

This commit is contained in:
2026-07-21 04:18:29 +00:00
committed by didericis
parent 9b6788ebad
commit 4cc3635794
2 changed files with 74 additions and 10 deletions
+3 -2
View File
@@ -23,6 +23,7 @@ import time
import urllib.error
import urllib.request
from pathlib import Path
from typing import Any
from ..paths import bot_bottle_root
@@ -49,7 +50,7 @@ def _flag(argv: list[str], name: str) -> str | None:
return None
def _post(url: str, payload: dict) -> dict:
def _post(url: str, payload: dict[str, Any]) -> dict[str, Any]:
data = json.dumps(payload).encode()
req = urllib.request.Request(
url, data=data, headers={"Content-Type": "application/json"}
@@ -58,7 +59,7 @@ def _post(url: str, payload: dict) -> dict:
return json.loads(resp.read())
def _get(url: str) -> tuple[int, dict]:
def _get(url: str) -> tuple[int, dict[str, Any]]:
req = urllib.request.Request(url)
try:
with urllib.request.urlopen(req, timeout=10) as resp: