Show trading playbook in hub strategy docs.

Add an 执行手册 tab that renders docs/交易执行手册-期权与Gate.md as the default strategy view.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-21 22:16:54 +08:00
parent 301a464f29
commit e7f8e9201e
6 changed files with 32 additions and 12 deletions
+11 -2
View File
@@ -12,10 +12,19 @@ from lib.hub.hub_strategy_lib import (
class TestHubStrategyLib(unittest.TestCase):
def test_meta_has_three_exchanges(self):
def test_meta_has_playbook_and_exchanges(self):
meta = strategy_meta_payload()
keys = [x["key"] for x in meta["exchanges"]]
self.assertEqual(keys, ["binance", "okx", "gate"])
self.assertEqual(keys, ["playbook", "binance", "okx", "gate"])
def test_load_playbook_payload(self):
p = load_strategy_payload("playbook")
self.assertTrue(p["ok"])
self.assertEqual(p["label"], "执行手册")
self.assertIn("交易执行手册", p["md_source"])
self.assertIn("strategy_html", p)
self.assertIn("<h2", p["strategy_html"].lower())
self.assertIn("总原则", p["strategy_html"])
def test_load_binance_payload(self):
p = load_strategy_payload("binance")