mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-17 16:10:12 +01:00
fix(lint): improved type checking and code maintainability
This commit is contained in:
parent
83fe527979
commit
40023e93b8
62 changed files with 187 additions and 197 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
from code.web.services.theme_preview import get_theme_preview, bust_preview_cache # type: ignore
|
||||
from code.web.services import preview_cache as pc # type: ignore
|
||||
from code.web.services.theme_preview import get_theme_preview, bust_preview_cache
|
||||
from code.web.services import preview_cache as pc
|
||||
|
||||
|
||||
def test_basic_low_score_eviction(monkeypatch):
|
||||
|
|
@ -17,7 +17,7 @@ def test_basic_low_score_eviction(monkeypatch):
|
|||
get_theme_preview('Blink', limit=6, colors=c)
|
||||
# Cache limit 5, inserted 6 distinct -> eviction should have occurred
|
||||
assert len(pc.PREVIEW_CACHE) <= 5
|
||||
from code.web.services.preview_metrics import preview_metrics # type: ignore
|
||||
from code.web.services.preview_metrics import preview_metrics
|
||||
m = preview_metrics()
|
||||
assert m['preview_cache_evictions'] >= 1, 'Expected at least one eviction'
|
||||
assert m['preview_cache_evictions_by_reason'].get('low_score', 0) >= 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue