aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2020-12-28 00:25:31 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2020-12-28 00:25:31 +0000
commit421d8de29d17d9390cae1f56bfc98667158a8096 (patch)
treefc1ddf31c5a0b36c43d0fef83402e309c20d409a /tests
parentBump version and update changelog and readme (diff)
downloadpaper2remarkable-421d8de29d17d9390cae1f56bfc98667158a8096.tar.gz
paper2remarkable-421d8de29d17d9390cae1f56bfc98667158a8096.zip
Add support for a configuration file
Diffstat (limited to 'tests')
-rw-r--r--tests/test_html.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index 7d5c92b..41f6b83 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -9,7 +9,6 @@ This file is part of paper2remarkable.
import os
import pdfplumber
-import tempfile
import unittest
from paper2remarkable.providers.html import HTML
@@ -39,24 +38,12 @@ class TestHTML(unittest.TestCase):
"https://fonts.googleapis.com/css2?family=Montserrat&display=swap"
]
- tmpfd, tempfname_css = tempfile.mkstemp(prefix="p2r_", suffix=".css")
- with os.fdopen(tmpfd, "w") as fp:
- fp.write(test_css)
-
- tmpfd, tempfname_urls = tempfile.mkstemp(prefix="p2r_", suffix=".txt")
- with os.fdopen(tmpfd, "w") as fp:
- fp.write("\n".join(test_font_urls))
-
url = "https://hbr.org/2019/11/getting-your-team-to-do-more-than-meet-deadlines"
- prov = HTML(
- upload=False, css_path=tempfname_css, font_urls_path=tempfname_urls
- )
+ prov = HTML(upload=False, css=test_css, font_urls=test_font_urls)
filename = prov.run(url)
with pdfplumber.open(filename) as pdf:
self.assertEqual(8, len(pdf.pages))
- os.unlink(tempfname_css)
- os.unlink(tempfname_urls)
os.unlink(filename)