afp-backend / tests /unit /test_reference_normalization.py
cdupland
Implement price import functionality with support for CSV and Excel formats. Add API endpoint for starting price imports, including validation and error handling. Introduce new schemas, services, and repositories for price data management. Update documentation to reflect new features and usage. Enhance tests to cover the added functionality.
0f8d56c
import pytest
from app.domain.reference_normalization import normalize_reference
@pytest.mark.unit
@pytest.mark.parametrize(
("raw", "expected"),
[
("a12", "12"),
("A12", "A12"),
("aA12", "A12"),
("a", None),
("", None),
(None, None),
(" a12 ", "12"),
("12345", "12345"),
("aa12", "a12"),
],
)
def test_normalize_reference(raw: str | None, expected: str | None) -> None:
assert normalize_reference(raw) == expected