修复删对冲后持仓接口 NameError:恢复 tgt_map/profit_exit_map 赋值。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -56,6 +56,17 @@ class RemoveHedgeSmokeTests(unittest.TestCase):
|
||||
self.assertFalse(tab_allowed("hedge_plan"))
|
||||
self.assertNotIn("hedge_plan", EMBED_TABS)
|
||||
|
||||
def test_positions_api_still_builds_target_maps(self):
|
||||
"""删对冲时勿再漏掉 tgt_map / profit_exit_map 赋值,否则有仓时接口 500、前端暂无持仓."""
|
||||
import inspect
|
||||
from lib.options import options_register
|
||||
|
||||
src = inspect.getsource(options_register.register_options_routes)
|
||||
self.assertIn("tgt_map = targets_by_inst(conn)", src)
|
||||
self.assertIn("profit_exit_map = profit_exit_by_inst(conn)", src)
|
||||
self.assertNotIn("hedge_target_map", src)
|
||||
self.assertNotIn("hedge_plan_target", src)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user