Download tests/test_pdf_parser.py from build-small-hackathon/plane-mode-scholar: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/plane-mode-scholar/resolve/main/tests/test_pdf_parser.py
- Command line
-
hf download hf://spaces/build-small-hackathon/plane-mode-scholar/tests/test_pdf_parser.py
-
curl -L -o test_pdf_parser.py https://huggingface.co/spaces/build-small-hackathon/plane-mode-scholar/resolve/main/tests/test_pdf_parser.py
612 Bytes
| """Tests for file ingestion parsers.""" | |
| from __future__ import annotations | |
| import unittest | |
| from plane_mode_scholar.ingestion.pdf_parser import parse_file | |
| class PdfParserTests(unittest.TestCase): | |
| def test_demo_notes_txt(self) -> None: | |
| text, pages = parse_file("plane_mode_scholar/data/demo_notes.txt") | |
| self.assertTrue(text.strip()) | |
| self.assertEqual(len(pages), 1) | |
| def test_unsupported_suffix(self) -> None: | |
| text, pages = parse_file("readme.docx") | |
| self.assertEqual(text, "") | |
| self.assertEqual(pages, []) | |
| if __name__ == "__main__": | |
| unittest.main() | |