import pytest
from src.live.cerbero_client import CerberoClient


@pytest.mark.network
def test_get_historical_v2_shape():
    cli = CerberoClient()
    candles = cli.get_historical_v2("BTC-PERPETUAL", "2026-05-25", "2026-05-27", "1h")
    assert len(candles) > 0
    c0 = candles[0]
    assert {"timestamp", "open", "high", "low", "close", "volume"} <= set(c0)


@pytest.mark.network
def test_get_instruments_returns_list():
    cli = CerberoClient()
    inst = cli.get_instruments("ETH", "future")
    assert isinstance(inst, list) and len(inst) > 0
