Spaces:
Sleeping
Sleeping
Download tests/test_pdf_export.py from baljot07/studiq-backend: direct link, hf CLI and curl.
- Browser
- Download file 954 Bytes
-
https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_pdf_export.py
- Command line
-
hf download hf://spaces/baljot07/studiq-backend/tests/test_pdf_export.py
-
curl -L -o test_pdf_export.py https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_pdf_export.py
954 Bytes
| """Unit tests for PDF export accent color and section parsing logic.""" | |
| import pytest | |
| from app.services.pdf_service import _subject_accent, _parse_answer_into_sections | |
| def test_subject_accent_computer_science(): | |
| """Verify CS subjects receive navy blue accent.""" | |
| assert _subject_accent("Data Structures and Algorithms") == "#1E3A5F" | |
| assert _subject_accent("Python Programming") == "#1E3A5F" | |
| def test_subject_accent_mathematics(): | |
| """Verify Math subjects receive green accent.""" | |
| assert _subject_accent("Discrete Mathematics") == "#14532D" | |
| def test_parse_markdown_sections(): | |
| """Verify markdown headings and code blocks parse into structured items.""" | |
| md = "### Introduction\nThis is text.\n```python\nprint(1)\n```" | |
| sections = _parse_answer_into_sections(md) | |
| assert len(sections) == 3 | |
| assert sections[0]["type"] == "heading" | |
| assert sections[1]["type"] == "text" | |
| assert sections[2]["type"] == "code" | |