feat(data): DataReader SQLite + 交易所判断 + vnpy 4.4.0 spike 点
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user