from ldnode.loader.files import (
    ETF_DATA,
    ETF_PRE_QUOTATION,
    ETF_QUOTATION,
    FUND_DATA,
    FUND_PRE_QUOTATION,
    FUND_QUOTATION,
)
from ldnode.loader.data_time import DATASET_REGISTRY


def test_fund_loader_uses_fund_backtest_data_index() -> None:
    assert FUND_DATA.key == "backtest_data/fund.parquet"


def test_fund_loader_uses_fund_before_trading_data_index() -> None:
    assert FUND_PRE_QUOTATION.key == "before_trading_data/fund.parquet"


def test_fund_loader_uses_fund_realtime_quotation_index() -> None:
    assert FUND_QUOTATION.key == "fund_quotations.pq"


def test_etf_loader_names_remain_compatible_with_fund_indexes() -> None:
    assert ETF_DATA is FUND_DATA
    assert ETF_PRE_QUOTATION is FUND_PRE_QUOTATION
    assert ETF_QUOTATION is FUND_QUOTATION


def test_fund_snapshot_status_reports_legacy_etf_dataset_name() -> None:
    registry = {dataset_name: file for dataset_name, _, file in DATASET_REGISTRY}

    assert registry["ETF_DATA"] is FUND_DATA
    assert "FUND_DATA" not in registry
