"""download_backends — the single predicate that routes a platform to the
native ingester vs. gallery-dl. Pure, no DB."""

from backend.app.services.download_backends import (
    NATIVE_INGESTER_PLATFORMS,
    uses_native_ingester,
)


def test_native_platforms():
    for platform in ("patreon", "subscribestar"):
        assert uses_native_ingester(platform) is True
        assert platform in NATIVE_INGESTER_PLATFORMS


def test_gallery_dl_platforms_are_not_native():
    # The platforms still served by gallery-dl must NOT route to the native
    # ingester — guards an accidental over-broad migration.
    for platform in ("hentaifoundry", "discord", "pixiv", "deviantart"):
        assert uses_native_ingester(platform) is False


def test_unknown_platform_is_not_native():
    assert uses_native_ingester("nonsense") is False
