Files
evotraders/backend/tests/test_provider_utils.py
2026-03-30 17:46:44 +08:00

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"