Spaces:
Sleeping
Sleeping
StudIQ Deploy Bot
fix(deploy): restore Hugging Face Space YAML configuration frontmatter in README.md
474d164 Download tests/test_ocr_encoding.py from baljot07/studiq-backend: direct link, hf CLI and curl.
- Browser
- Download file 474 Bytes
-
https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_ocr_encoding.py
- Command line
-
hf download hf://spaces/baljot07/studiq-backend/tests/test_ocr_encoding.py
-
curl -L -o test_ocr_encoding.py https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_ocr_encoding.py
474 Bytes
| """Unit tests for OCR payload data URI formatting.""" | |
| import base64 | |
| import pytest | |
| def test_base64_data_uri_formatting(): | |
| """Ensure raw image bytes format into proper RFC 2397 data URIs.""" | |
| dummy_bytes = b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR" | |
| mime_type = "image/png" | |
| b64 = base64.b64encode(dummy_bytes).decode("utf-8") | |
| data_uri = f"data:{mime_type};base64,{b64}" | |
| assert data_uri.startswith("data:image/png;base64,") | |
| assert b64 in data_uri | |