Skip to content

Commit

Permalink
Switching from PyPDF2 to pypdf
Browse files Browse the repository at this point in the history
  • Loading branch information
chazeon committed Sep 23, 2023
1 parent 9d42a41 commit 910f48e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
2 changes: 1 addition & 1 deletion remove.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyPDF2 import PdfReader, PdfWriter
from pypdf import PdfReader, PdfWriter

def removeWatermark(input_fname: str, output_fname: str):

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PyPDF2
pypdf
Binary file added tests/lorem.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions tests/test_remove.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pytest
import importlib
import sys
from pathlib import Path

TESTS_DIR = Path(__file__).parent

from remove import removeWatermark

sys.path.insert(0, str(TESTS_DIR.parent))

@pytest.mark.parametrize("ifname", [TESTS_DIR / "lorem.pdf"])
def test_removal(ifname):
ofname = TESTS_DIR / ("%s.out.pdf" % (Path(ifname).stem,))
removeWatermark(str(ifname), str(ofname))

0 comments on commit 910f48e

Please sign in to comment.