fix(HEL-494): 日K默认45根并修复问天行业0/205覆盖
悬浮窗和详情页只画最近45个交易日,中枢仍保留250日历史。盘后缺sw_daily时保留成分日线内核,外显走免费申万;成分行情改为全市场快照+分页,不再截成前60只。 Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
3e828b346c
commit
b5d65ecb41
@@ -219,6 +219,18 @@ class MarketQuotesTests(unittest.TestCase):
|
||||
payload = self.api.handle("/v1/quotes/latest", {"codes": ["600000.SH"]})
|
||||
mocked.return_value.fetch_market_quotes.assert_not_called()
|
||||
self.assertEqual(payload["data"][0]["ts_code"], "600000.SH")
|
||||
self.assertEqual(payload["meta"]["source"], "eastmoney:ulist")
|
||||
|
||||
def test_named_quotes_page_beyond_sixty_codes(self) -> None:
|
||||
codes = [f"{index:06d}.SZ" for index in range(70)]
|
||||
def fake_fetch(chunk):
|
||||
return [{"ts_code": code, "close": 10, "pre_close": 9} for code in chunk]
|
||||
|
||||
with patch("datahub.realtime_serve.EastmoneyAdapter") as mocked:
|
||||
mocked.return_value.fetch_quotes.side_effect = fake_fetch
|
||||
payload = self.api.handle("/v1/quotes/latest", {"codes": [",".join(codes)]})
|
||||
self.assertEqual(mocked.return_value.fetch_quotes.call_count, 2)
|
||||
self.assertEqual(len(payload["data"]), 70)
|
||||
|
||||
def test_market_unavailable_stays_source_error(self) -> None:
|
||||
with patch("datahub.realtime_serve.EastmoneyAdapter") as mocked:
|
||||
|
||||
Reference in New Issue
Block a user