5797d49d8a
统一 strategy、key_monitor、trade、hub 等共用库到 lib/ 子包,并补充 lib-structure 文档,便于四所与中控维护。 Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
769 B
Python
27 lines
769 B
Python
from lib.instance.instance_embed_lib import (
|
|
EMBED_TABS,
|
|
path_to_embed_tab,
|
|
rewrite_embed_dest,
|
|
)
|
|
|
|
|
|
def test_path_to_embed_tab():
|
|
assert path_to_embed_tab("/trade") == "trade"
|
|
assert path_to_embed_tab("/key_monitor") == "key_monitor"
|
|
assert path_to_embed_tab("/strategy/records") == "strategy_records"
|
|
assert path_to_embed_tab("/unknown") is None
|
|
|
|
|
|
def test_rewrite_embed_dest():
|
|
url = rewrite_embed_dest("/trade", hub_theme="dark")
|
|
assert url.startswith("/embed?")
|
|
assert "tab=trade" in url
|
|
assert "embed=1" in url
|
|
assert "hub_theme=dark" in url
|
|
|
|
|
|
def test_embed_tabs_cover_main_nav():
|
|
assert "trade" in EMBED_TABS
|
|
assert "key_monitor" in EMBED_TABS
|
|
assert "records" in EMBED_TABS
|