diff --git a/.gitignore b/.gitignore index f26cd99..949d97e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,5 @@ tests/*.xml tests/*.txt .idea/ .vscode -samples/output -samples/pdfmajor +tests/samples/output **__pycache** \ No newline at end of file diff --git a/samples/pdf/long-tables.pdf b/samples/pdf/long-tables.pdf deleted file mode 100644 index bc04482..0000000 Binary files a/samples/pdf/long-tables.pdf and /dev/null differ diff --git a/samples/pdfmajor b/samples/pdfmajor deleted file mode 120000 index 0b558f8..0000000 --- a/samples/pdfmajor +++ /dev/null @@ -1 +0,0 @@ -../pdfmajor \ No newline at end of file diff --git a/samples/pdf/bad-chars.pdf b/tests/samples/pdf/bad-chars.pdf similarity index 100% rename from samples/pdf/bad-chars.pdf rename to tests/samples/pdf/bad-chars.pdf diff --git a/samples/pdf/bar-charts.pdf b/tests/samples/pdf/bar-charts.pdf similarity index 100% rename from samples/pdf/bar-charts.pdf rename to tests/samples/pdf/bar-charts.pdf diff --git a/samples/pdf/chars.pdf b/tests/samples/pdf/chars.pdf similarity index 100% rename from samples/pdf/chars.pdf rename to tests/samples/pdf/chars.pdf diff --git a/samples/pdf/colors.pdf b/tests/samples/pdf/colors.pdf similarity index 100% rename from samples/pdf/colors.pdf rename to tests/samples/pdf/colors.pdf diff --git a/samples/pdf/font-color.pdf b/tests/samples/pdf/font-color.pdf similarity index 100% rename from samples/pdf/font-color.pdf rename to tests/samples/pdf/font-color.pdf diff --git a/samples/pdf/fonts.pdf b/tests/samples/pdf/fonts.pdf similarity index 100% rename from samples/pdf/fonts.pdf rename to tests/samples/pdf/fonts.pdf diff --git a/samples/pdf/line-charts.pdf b/tests/samples/pdf/line-charts.pdf similarity index 100% rename from samples/pdf/line-charts.pdf rename to tests/samples/pdf/line-charts.pdf diff --git a/samples/pdf/tables.pdf b/tests/samples/pdf/tables.pdf similarity index 100% rename from samples/pdf/tables.pdf rename to tests/samples/pdf/tables.pdf diff --git a/tests/test_extraction.py b/tests/test_extraction.py index ac552e0..dedeae3 100755 --- a/tests/test_extraction.py +++ b/tests/test_extraction.py @@ -13,8 +13,8 @@ def rel_path(*arg: List[str]) -> str: return os.path.normpath(os.path.join(os.path.dirname(__file__), *arg)) EXTS = ['json','xml','html'] -INPUT_FOLDER = rel_path("./pdf") -OUTPUT_FOLDER = rel_path(f"./output/") +INPUT_FOLDER = rel_path("./samples/pdf") +OUTPUT_FOLDER = rel_path(f"./samples/output/") if not os.path.exists(OUTPUT_FOLDER): os.makedirs(OUTPUT_FOLDER) diff --git a/tests/test_interpreter.py b/tests/test_interpreter.py index cfba498..9ae79c3 100644 --- a/tests/test_interpreter.py +++ b/tests/test_interpreter.py @@ -8,8 +8,8 @@ from pdfmajor.interpreter.commands import LTCharBlock, LTChar CUR_PATH = os.path.dirname(os.path.dirname(__file__)) FILE_NAME = os.path.join( - "../" if CUR_PATH == "" else CUR_PATH, - "samples/pdf/long-tables.pdf" + CUR_PATH, + "samples/pdf/tables.pdf" ) for page in PDFInterpreter(FILE_NAME, debug_level=logging.INFO): diff --git a/tests/test_pdfmajor_ccitt.py b/tests/test_pdfmajor_ccitt.py index 963166e..5ac9ad8 100644 --- a/tests/test_pdfmajor_ccitt.py +++ b/tests/test_pdfmajor_ccitt.py @@ -8,7 +8,7 @@ import nose import logging -from pdfmajor.interpreter.PDFStream.ccitt import CCITTG4Parser +from pdfmajor.parser.PDFStream.ccitt import CCITTG4Parser ## Test cases ## diff --git a/tests/test_pdfmajor_crypto.py b/tests/test_pdfmajor_crypto.py index a118a11..ef87d25 100644 --- a/tests/test_pdfmajor_crypto.py +++ b/tests/test_pdfmajor_crypto.py @@ -8,7 +8,7 @@ import nose #test of various compression/encoding modules (previously in doctests): from pdfmajor.utils.ascii85 import ascii85decode, asciihexdecode from pdfmajor.utils.lzw import LZWDecoder, lzwdecode -from pdfmajor.interpreter.PDFStream import rldecode +from pdfmajor.parser.PDFStream import rldecode import binascii def hex(b): return binascii.hexlify(b) #encode('hex') diff --git a/tests/test_pdfmajor_psparser.py b/tests/test_pdfmajor_psparser.py index 8cc9704..b146b68 100644 --- a/tests/test_pdfmajor_psparser.py +++ b/tests/test_pdfmajor_psparser.py @@ -8,7 +8,7 @@ import nose import logging -from pdfmajor.interpreter.PSStackParser import KWD, LIT, PSBaseParser, PSEOF, PSStackParser +from pdfmajor.parser.PSStackParser import KWD, LIT, PSBaseParser, PSEOF, PSStackParser ## Simplistic Test cases ##