from fxhnt.adapters.warehouse.duckdb_feature_store import DuckDbFeatureStore


def test_crypto_spot_panel_reads_spot_close(tmp_path):
    st = DuckDbFeatureStore(str(tmp_path / "w.duckdb"))
    st.write_features("BTCUSDT", [(86400, {"spot_close": 100.0}), (172800, {"spot_close": 110.0})])
    st.write_features("BTCUSDT", [(86400, {"close": 99.0})])  # perp close must NOT leak
    assert st.crypto_spot_panel()["BTCUSDT"] == {1: 100.0, 2: 110.0}
