feat(market-data): 优化同步并增加完整性检查
This commit is contained in:
@@ -13,6 +13,7 @@ from zhixing_server.modules.market_data.domain.models import (
|
||||
DailyBasic,
|
||||
Stock,
|
||||
SyncWindow,
|
||||
decimal_text,
|
||||
)
|
||||
from zhixing_server.modules.market_data.domain.rules import filter_current_hs_a_stocks
|
||||
|
||||
@@ -65,6 +66,12 @@ def test_daily_basic_maps_nan_to_none_but_rejects_infinite_values() -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_decimal_text_rejects_non_finite_domain_values() -> None:
|
||||
for value in (Decimal("NaN"), Decimal("Infinity"), Decimal("-Infinity")):
|
||||
with pytest.raises(ValueError, match="must be finite"):
|
||||
decimal_text(value)
|
||||
|
||||
|
||||
def test_universe_keeps_current_non_st_hs_a_stocks() -> None:
|
||||
stocks = (
|
||||
Stock("000001.SZ", "平安银行", exchange="SZSE", list_status="L"),
|
||||
|
||||
Reference in New Issue
Block a user