mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 16:07:01 +08:00
refactor backend module architecture
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from app.helper.webpush import (
|
||||
import importlib
|
||||
|
||||
from app.api.endpoints.message import (
|
||||
is_webpush_subscription_gone,
|
||||
is_wns_endpoint,
|
||||
webpush_options_for_endpoint,
|
||||
@@ -41,3 +43,11 @@ def test_webpush_options_for_wns_endpoint() -> None:
|
||||
|
||||
def test_webpush_options_for_non_wns_endpoint() -> None:
|
||||
assert webpush_options_for_endpoint("https://fcm.googleapis.com/fcm/send/abc") == {}
|
||||
|
||||
|
||||
def test_legacy_webpush_path_reuses_message_endpoint() -> None:
|
||||
"""旧 Web Push helper 路径应复用消息端点中的同一实现。"""
|
||||
legacy = importlib.import_module("app.helper.webpush")
|
||||
|
||||
assert legacy.is_webpush_subscription_gone is is_webpush_subscription_gone
|
||||
assert legacy.webpush_options_for_endpoint is webpush_options_for_endpoint
|
||||
|
||||
Reference in New Issue
Block a user