fix(HEL-356): use completed history for intraday metrics
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -180,7 +180,13 @@ class RealtimeDashboardTests(unittest.TestCase):
|
||||
self.client.try_quotes = lambda codes: [
|
||||
row for row in FREE_QUOTES if row["ts_code"] in set(codes)
|
||||
]
|
||||
quote = self.client.realtime_stock_quote("000003.SZ")
|
||||
calls = []
|
||||
original_query = self.client.query
|
||||
self.client.query = lambda api, params=None, fields="": (
|
||||
calls.append((api, dict(params or {})))
|
||||
or original_query(api, params, fields)
|
||||
)
|
||||
quote = self.client.realtime_stock_quote("000003.SZ", "20260720")
|
||||
|
||||
self.assertEqual(quote["name"], "丙")
|
||||
self.assertEqual(quote["sector"], "元器件")
|
||||
@@ -188,6 +194,12 @@ class RealtimeDashboardTests(unittest.TestCase):
|
||||
self.assertEqual(quote["amount_billion"], 3.0)
|
||||
self.assertAlmostEqual(quote["turnover_rate"], 0.01)
|
||||
self.assertEqual(quote["trade_date"], "20260720")
|
||||
history_calls = [
|
||||
params for api, params in calls
|
||||
if api in {"daily", "daily_basic"} and params.get("start_date")
|
||||
]
|
||||
self.assertTrue(history_calls)
|
||||
self.assertTrue(all(params.get("end_date") == "20260719" for params in history_calls))
|
||||
|
||||
def test_close_dashboard_marks_official_limit_data(self):
|
||||
dashboard = self.client.dashboard("20260720")
|
||||
|
||||
Reference in New Issue
Block a user