5797d49d8a
统一 strategy、key_monitor、trade、hub 等共用库到 lib/ 子包,并补充 lib-structure 文档,便于四所与中控维护。 Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
524 B
Python
22 lines
524 B
Python
from lib.instance.instance_nav_lib import request_is_hub_soft_nav
|
|
|
|
|
|
def test_request_is_hub_soft_nav():
|
|
class Req:
|
|
args = {"embed": "1"}
|
|
headers = {"X-Instance-Soft-Nav": "1"}
|
|
|
|
assert request_is_hub_soft_nav(Req()) is True
|
|
|
|
class Req2:
|
|
args = {"embed": "1"}
|
|
headers = {}
|
|
|
|
assert request_is_hub_soft_nav(Req2()) is False
|
|
|
|
class Req3:
|
|
args = {}
|
|
headers = {"X-Instance-Soft-Nav": "1"}
|
|
|
|
assert request_is_hub_soft_nav(Req3()) is False
|