Files
040-personal-flight-club/tests/test_cache.py
Tirsvad 2f3bdd41e2
Quality checks / quality-checks (pull_request) Successful in 27s
Quality / quality (pull_request) Successful in 27s
English comments / english-comments (pull_request) Successful in 26s
Tests / pytest (pull_request) Successful in 49s
Carry over the Day 39 code, tests, CI workflows, Doxyfile and env template
Task: MIL-001#1
Task: MIL-001#2
Task: MIL-001#3
Task: MIL-001#4
Task: MIL-001#5
2026-10-24 23:38:25 +08:00

17 lines
568 B
Python

from unittest.mock import MagicMock, patch
import requests_cache
from flight_club.cache import install_flight_cache
from flight_club.constants import CACHE_EXPIRE_SECONDS, CACHE_NAME, SHEETY_HOST
def test_install_flight_cache_never_caches_sheety() -> None:
with patch("flight_club.cache.requests_cache.install_cache", new=MagicMock()) as install:
install_flight_cache()
install.assert_called_once_with(
CACHE_NAME,
expire_after=CACHE_EXPIRE_SECONDS,
urls_expire_after={f"{SHEETY_HOST}*": requests_cache.DO_NOT_CACHE},
)