(shared_datadir, build_example)
| 22 | ], |
| 23 | ) |
| 24 | def test_pdf_feature_encode_example(shared_datadir, build_example): |
| 25 | import pdfplumber |
| 26 | |
| 27 | pdf_path = str(shared_datadir / "test_pdf.pdf") |
| 28 | pdf = Pdf() |
| 29 | encoded_example = pdf.encode_example(build_example(pdf_path)) |
| 30 | assert isinstance(encoded_example, dict) |
| 31 | assert encoded_example.keys() == {"bytes", "path"} |
| 32 | assert encoded_example["bytes"] is not None or encoded_example["path"] is not None |
| 33 | decoded_example = pdf.decode_example(encoded_example) |
| 34 | assert isinstance(decoded_example, pdfplumber.pdf.PDF) |
| 35 | |
| 36 | |
| 37 | @require_pdfplumber |
nothing calls this directly
no test coverage detected