From c9d6be6847b6a490fdda45dc7c9499b0fcae667f Mon Sep 17 00:00:00 2001 From: Kharec Date: Tue, 17 Feb 2026 14:26:00 +0100 Subject: [PATCH] test: model StubDownloads state with a dataclass --- tests/test_table_utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_table_utils.py b/tests/test_table_utils.py index f3d273f..3aec19b 100644 --- a/tests/test_table_utils.py +++ b/tests/test_table_utils.py @@ -1,3 +1,6 @@ +from dataclasses import dataclass +from typing import Any, cast + from auditui import table_utils @@ -25,9 +28,9 @@ class StubLibrary: return item.get("asin") +@dataclass(slots=True) class StubDownloads: - def __init__(self, cached: set[str]) -> None: - self._cached = cached + _cached: set[str] def is_cached(self, asin: str) -> bool: return asin in self._cached @@ -63,7 +66,7 @@ def test_format_item_as_row_with_downloaded() -> None: "asin": "ASIN123", } title, author, runtime, progress, downloaded = table_utils.format_item_as_row( - item, library, downloads + item, library, cast(Any, downloads) ) assert title == "Title" assert author == "Author One"