feat(data): DataReader SQLite + 交易所判断 + vnpy 4.4.0 spike 点

This commit is contained in:
2026-07-05 12:36:34 +08:00
parent 91d9c36f44
commit 4e541040f1
2 changed files with 33 additions and 2 deletions
+9 -1
View File
@@ -1,7 +1,7 @@
import pandas as pd
from vnpy.trader.constant import Exchange, Interval
from sanguo_data.config import DataConfig
from sanguo_data.datareader import read_parquet_daily
from sanguo_data.datareader import read_parquet_daily, guess_exchange
def test_read_parquet_daily_returns_bardata(tmp_path):
year_dir = tmp_path / "2026"
@@ -22,3 +22,11 @@ def test_read_parquet_daily_returns_bardata(tmp_path):
assert len(bars) == 2
assert bars[0].symbol == "600000"
assert bars[0].open_price == 10.0
def test_guess_exchange_sh():
assert guess_exchange("600000").value == "SSE"
def test_guess_exchange_sz():
assert guess_exchange("000001").value == "SZSE"