forked from waditu/czsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_data.py
35 lines (28 loc) · 1.14 KB
/
test_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
"""
author: zengbin93
email: [email protected]
create_dt: 2022/2/24 16:39
describe: data 模块的单元测试
"""
from czsc import data
def test_symbol_converter():
jq_symbol = "300033.XSHE"
gm_symbol = "SZSE.300033"
ts_symbol = "300033.SZ"
tdx_symbol = "0300033"
assert data.gm_symbol_to_ts(gm_symbol) == ts_symbol
assert data.gm_symbol_to_jq(gm_symbol) == jq_symbol
assert data.gm_symbol_to_tdx(gm_symbol) == tdx_symbol
assert data.jq_symbol_to_gm(jq_symbol) == gm_symbol
assert data.jq_symbol_to_ts(jq_symbol) == ts_symbol
assert data.jq_symbol_to_tdx(jq_symbol) == tdx_symbol
assert data.ts_symbol_to_tdx(ts_symbol) == tdx_symbol
assert data.ts_symbol_to_gm(ts_symbol) == gm_symbol
assert data.ts_symbol_to_jq(ts_symbol) == jq_symbol
assert data.ts_symbol_to_jq(ts_symbol) == jq_symbol
assert data.ts_symbol_to_gm(ts_symbol) == gm_symbol
assert data.ts_symbol_to_tdx(ts_symbol) == tdx_symbol
assert data.tdx_symbol_to_ts(tdx_symbol) == ts_symbol
assert data.tdx_symbol_to_gm(tdx_symbol) == gm_symbol
assert data.tdx_symbol_to_jq(tdx_symbol) == jq_symbol