env 锁定币本位并清掉对冲/USDC 配置项。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -72,16 +72,30 @@ class RemoveHedgeSmokeTests(unittest.TestCase):
|
||||
from lib.env.env_schema import select_options_for
|
||||
|
||||
titles = [s["title"] for s in ui_sections_for_exchange("okx")]
|
||||
self.assertNotIn("期权/对冲模式", titles)
|
||||
self.assertTrue(any("对冲" not in t for t in titles))
|
||||
for t in titles:
|
||||
self.assertNotIn("对冲", t)
|
||||
labels = [f[1] for s in ui_sections_for_exchange("okx") for f in s["fields"]]
|
||||
for lab in labels:
|
||||
self.assertNotIn("对冲", lab)
|
||||
keys = [f[0] for s in ui_sections_for_exchange("okx") for f in s["fields"]]
|
||||
self.assertNotIn("OKX_OPTIONS_MARGIN_MODE", keys)
|
||||
self.assertNotIn("OKX_OPTIONS_TRADE_BUDGET_USDC", keys)
|
||||
self.assertNotIn("OKX_OPTIONS_COMPOUND_FULL_ENABLED", keys)
|
||||
self.assertNotIn("OKX_OPTIONS_CLOSE_RECYCLE_MULT", keys)
|
||||
self.assertIn("OKX_OPTIONS_COIN_COMPOUND", keys)
|
||||
mode_opts = [o["value"] for o in select_options_for("OKX_TRADE_MODE")]
|
||||
self.assertEqual(mode_opts, ["options"])
|
||||
|
||||
def test_margin_mode_locked_coin(self):
|
||||
from lib.options.options_margin_mode_lib import (
|
||||
is_coin_margin_mode,
|
||||
normalize_options_margin_mode,
|
||||
)
|
||||
|
||||
self.assertEqual(normalize_options_margin_mode("usdc"), "coin")
|
||||
self.assertEqual(normalize_options_margin_mode("coin"), "coin")
|
||||
self.assertTrue(is_coin_margin_mode("usdc"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user