16 lines
453 B
Python
16 lines
453 B
Python
# -*- coding: utf-8 -*-
|
|
"""Tests for market symbol normalization helpers."""
|
|
|
|
from backend.data.provider_utils import describe_symbol, normalize_symbol
|
|
|
|
|
|
def test_normalize_symbol_exchange_prefix():
|
|
assert normalize_symbol("sh600519") == "600519"
|
|
assert normalize_symbol("600519.SH") == "600519"
|
|
|
|
|
|
def test_normalize_symbol_us_ticker():
|
|
symbol = describe_symbol("aapl")
|
|
assert symbol.canonical == "AAPL"
|
|
assert symbol.market == "us"
|