Spaces:
Runtime error
Runtime error
Download tests/test_ocr_parse.py from jkos9/plotscribe: direct link, hf CLI and curl.
- Browser
- Download file 794 Bytes
-
https://huggingface.co/spaces/jkos9/plotscribe/resolve/main/tests/test_ocr_parse.py
- Command line
-
hf download hf://spaces/jkos9/plotscribe/tests/test_ocr_parse.py
-
curl -L -o test_ocr_parse.py https://huggingface.co/spaces/jkos9/plotscribe/resolve/main/tests/test_ocr_parse.py
794 Bytes
| import pytest | |
| from plotscribe.ocr import parse_number, parse_offset_text | |
| def test_parse_number(text, value): | |
| assert parse_number(text) == pytest.approx(value) | |
| def test_parse_number_rejects_text(text): | |
| assert parse_number(text) is None | |
| def test_offset_text(): | |
| assert parse_offset_text("1e6") == (1e6, 0.0) | |
| assert parse_offset_text("+1.063e3") == (1.0, 1063.0) | |
| assert parse_offset_text("Results") is None | |