import pandas as pd
from src.portfolio import sleeves as S

ALL_IDS = {"MR01_BTC", "MR02_BTC", "MR07_BTC", "MR01_ETH", "MR02_ETH", "MR07_ETH",
           "DIP01_BTC", "TR01_basket", "ROT02_rot",
           "PR_ETHBTC", "PR_LTCETH", "PR_ADAETH", "PR_BTCLTC", "PR_ETHSOL",
           "TSM01", "SH_BTC", "SH_ETH"}


def test_all_sleeve_equities_keys_and_index():
    eq = S.all_sleeve_equities()
    assert ALL_IDS <= set(eq)
    s = eq["MR01_BTC"]
    assert isinstance(s, pd.Series) and len(s) > 100
    assert str(s.index.tz) == "UTC"


def test_returns_df_aligned():
    df = S.sleeve_returns_df(["MR01_BTC", "PR_ETHBTC", "SH_BTC"])
    assert list(df.columns) == ["MR01_BTC", "PR_ETHBTC", "SH_BTC"]
    assert df.isna().sum().sum() == 0
