Fix Binance linear market context
This commit is contained in:
@@ -5,7 +5,7 @@ from zoneinfo import ZoneInfo
|
||||
|
||||
import pytest
|
||||
|
||||
from llm_trade_bot.agent import AgentTools
|
||||
from llm_trade_bot.agent import AgentTools, _has_existing_idea
|
||||
from llm_trade_bot.config import (
|
||||
AppConfig,
|
||||
BraveConfig,
|
||||
@@ -102,3 +102,22 @@ async def test_pause_blocks_entry_from_running_session(tmp_path):
|
||||
)
|
||||
finally:
|
||||
await database.close()
|
||||
|
||||
|
||||
def test_seeded_spot_balance_does_not_block_new_agent_entry():
|
||||
state = {
|
||||
"wallets": {"spot": {"balances": [{"asset": "SOL", "free": "4", "locked": "0"}]}},
|
||||
"positions": [],
|
||||
"open_orders": [],
|
||||
}
|
||||
assert _has_existing_idea(state, "spot", "SOLUSDT") is False
|
||||
|
||||
state["open_orders"] = [
|
||||
{
|
||||
"category": "spot",
|
||||
"symbol": "SOLUSDT",
|
||||
"protective": True,
|
||||
"client_id": "ltb-12-abcd-tp",
|
||||
}
|
||||
]
|
||||
assert _has_existing_idea(state, "spot", "SOLUSDT") is True
|
||||
|
||||
Reference in New Issue
Block a user