Skip to content

Commit 0d34df0

Browse files
author
Vincent
committed
extra test added
1 parent f0cd5f9 commit 0d34df0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

prodigy_pdf/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def pdf_image_manual(
5555
) -> ControllerComponentsDict:
5656
"""Turns pdfs into images in order to annotate them."""
5757
# Read in stream as a list for progress bar.
58-
if not pdf_folder.exists():
58+
if not Path(pdf_folder).exists():
5959
msg.fail(f"Folder `{pdf_folder}` does not exist.", exits=True)
6060
pdf_paths = list(Path(pdf_folder).glob("*.pdf"))
6161
if len(pdf_paths) == 0:

tests/test_basics.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from pathlib import Path
2-
from prodigy_pdf import generate_pdf_pages, fold_ocr_dashes
2+
from prodigy_pdf import generate_pdf_pages, fold_ocr_dashes, pdf_image_manual
33

44

5-
def test_smoke_internal():
5+
def test_generate_pdf_pages():
66
# We know this one PDF has six pages.
77
paths = Path("tests/pdfs").glob("*.pdf")
88
pages = list(generate_pdf_pages(paths))
@@ -29,3 +29,8 @@ def test_fold_dashes():
2929

3030
expected = "Real-Time Strategy (RTS) games have become an increasingly popular test-bed for modern artificial intelligence techniques. With this rise in popularity has come the creation of several annual competitions, in which AI agents (bots) play the full game of StarCraft: Broodwar by Blizzard Entertainment. The three major annual StarCraft AI Competitions are the Student StarCraft AI Tournament (SSCAIT), the Computational Intelligence in Games (CIG) competition, and the Artificial Intelligence and Interactive Digital Entertainment (AIIDE) competition. In this paper we will give an overview of the current state of these competitions, and the bots that compete in them."
3131
assert fold_ocr_dashes(going_in) == expected
32+
33+
34+
def test_pdf_image_manual():
35+
components = pdf_image_manual("xxx", "tests/pdfs", "foo,bar")
36+
assert isinstance(next(components["stream"]), dict)

0 commit comments

Comments
 (0)