Spaces:
Runtime error
Runtime error
Download tests/test_normalize.py from Bubbles30/RemittanceVerifier: direct link, hf CLI and curl.
- Browser
- Download file 864 Bytes
-
https://huggingface.co/spaces/Bubbles30/RemittanceVerifier/resolve/main/tests/test_normalize.py
- Command line
-
hf download hf://spaces/Bubbles30/RemittanceVerifier/tests/test_normalize.py
-
curl -L -o test_normalize.py https://huggingface.co/spaces/Bubbles30/RemittanceVerifier/resolve/main/tests/test_normalize.py
864 Bytes
| from decimal import Decimal | |
| from invoice_reconciler.normalize import normalize_amount, normalize_invoice_number | |
| def test_invoice_number_preserved(): | |
| assert normalize_invoice_number(" PW117330 ") == "PW117330" | |
| assert normalize_invoice_number("PW117330") == "PW117330" | |
| assert normalize_invoice_number("INV-100") == "INV-100" | |
| def test_amount_currency_and_commas(): | |
| assert normalize_amount("$1,234.50") == Decimal("1234.50") | |
| assert normalize_amount("1234.50") == Decimal("1234.50") | |
| assert normalize_amount("$8.58") == Decimal("8.58") | |
| def test_negative_amounts(): | |
| assert normalize_amount("($12.00)") == Decimal("-12.00") | |
| assert normalize_amount("-12.00") == Decimal("-12.00") | |
| def test_blank_amount(): | |
| assert normalize_amount("") is None | |
| assert normalize_amount(None) is None | |
| assert normalize_amount("N/A") is None | |