-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable ruff for tests, fix failures, format
- Loading branch information
Showing
10 changed files
with
101 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import os | ||
import unittest | ||
|
||
from tex2pdf.service.pdf_watermark import add_watermark_text_to_pdf, Watermark | ||
from tex2pdf.service.pdf_watermark import Watermark, add_watermark_text_to_pdf | ||
|
||
SELF_DIR = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
watermark_pdf = os.path.join(SELF_DIR, "output/watermark.pdf") | ||
in_pdf = os.path.join(SELF_DIR, "fixture/smoke/Test.pdf") | ||
|
||
class MyTestCase(unittest.TestCase): | ||
|
||
class MyTestCase(unittest.TestCase): | ||
def setUp(self) -> None: | ||
os.makedirs(os.path.dirname(watermark_pdf), exist_ok=True) | ||
|
||
def test_watermarking(self): | ||
add_watermark_text_to_pdf(Watermark( | ||
"Water World is in Orlando, FL.", | ||
"https://en.wikipedia.org/wiki/Waterworld" | ||
), | ||
in_pdf, os.path.join(SELF_DIR, "output/Test.pdf") | ||
) | ||
|
||
if __name__ == '__main__': | ||
add_watermark_text_to_pdf( | ||
Watermark("Water World is in Orlando, FL.", "https://en.wikipedia.org/wiki/Waterworld"), | ||
in_pdf, | ||
os.path.join(SELF_DIR, "output/Test.pdf"), | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.