mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-10-04 22:05:45 +01:00
Backend test hardening + quality enforcement (#872)
- Reworked many tests - Enforcing lint + type checking for test suite - Fixed various issues surfaced by the new tests - CI tweaks
This commit is contained in:
@@ -12,10 +12,16 @@ def test_cache_results_isolated_by_content_type(monkeypatch):
|
||||
audiobook_release = Release(source="irc", source_id="audio", title="Shared Title", format="zip")
|
||||
|
||||
cache.cache_results("hardcover", "123", "Shared Title", [ebook_release], content_type="ebook")
|
||||
cache.cache_results("hardcover", "123", "Shared Title", [audiobook_release], content_type="audiobook")
|
||||
cache.cache_results(
|
||||
"hardcover", "123", "Shared Title", [audiobook_release], content_type="audiobook"
|
||||
)
|
||||
|
||||
ebook_cached = cache.get_cached_results("hardcover", "123", content_type="ebook", ttl_seconds=60)
|
||||
audiobook_cached = cache.get_cached_results("hardcover", "123", content_type="audiobook", ttl_seconds=60)
|
||||
ebook_cached = cache.get_cached_results(
|
||||
"hardcover", "123", content_type="ebook", ttl_seconds=60
|
||||
)
|
||||
audiobook_cached = cache.get_cached_results(
|
||||
"hardcover", "123", content_type="audiobook", ttl_seconds=60
|
||||
)
|
||||
|
||||
assert [release.source_id for release in ebook_cached["releases"]] == ["ebook"]
|
||||
assert [release.source_id for release in audiobook_cached["releases"]] == ["audio"]
|
||||
|
||||
Reference in New Issue
Block a user