feat条件单新建按标的过滤匹配币种的客户端。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -46,6 +46,30 @@ class TestCondCandidatesFunds(unittest.TestCase):
|
||||
self.assertFalse(out[1]["selectable"])
|
||||
self.assertIsNone(out[1]["trading_usdt"])
|
||||
self.assertTrue(out[1]["transfer_blocked"])
|
||||
self.assertEqual(out[0]["allowed_underlys"], ["ETH", "BTC"])
|
||||
|
||||
def test_candidates_carry_allowed_underlys(self):
|
||||
from lib.cond_orders_cache_lib import _candidates_from_snaps
|
||||
|
||||
rows = [
|
||||
{
|
||||
"id": 3,
|
||||
"name": "eth-only",
|
||||
"online": True,
|
||||
"error": "",
|
||||
"snapshot": {
|
||||
"positions_brief": [],
|
||||
"cond_order_locked": False,
|
||||
"instance": {"mode": "sim", "underly": "ETH", "allowed_underlys": ["ETH"]},
|
||||
"options_allowed_underlys": ["ETH"],
|
||||
"options_underly": "ETH",
|
||||
"funds": {"trading_usdt": 1.0, "funding_usdt": 2.0},
|
||||
},
|
||||
}
|
||||
]
|
||||
out = _candidates_from_snaps(rows)
|
||||
self.assertEqual(out[0]["allowed_underlys"], ["ETH"])
|
||||
self.assertEqual(out[0]["default_underly"], "ETH")
|
||||
|
||||
def test_open_url_tab_appended(self):
|
||||
from lib.sso_lib import build_embed_open_url
|
||||
|
||||
Reference in New Issue
Block a user