]> git.scottworley.com Git - paperdoorknob/blobdiff - paperdoorknob_test.py
Pass an ImageStore around
[paperdoorknob] / paperdoorknob_test.py
index aa50340ecfd7709ed3437b9ce006d22a5fe1804d..65fc2a9f308fbba82657389a87dd9b0971b312da 100644 (file)
@@ -15,6 +15,7 @@ import paperdoorknob
 from testing.fakeserver import FakeGlowficServer
 from domfilter import ApplyDOMFilters
 from fetch import DirectFetcher, FakeFetcher, Fetcher
+from images import ImageStore
 from spec import Spec
 from texify import DirectTexifier, PandocTexifier, VerifyingTexifier
 
@@ -46,12 +47,15 @@ class BaseTestProcess(ABC):
         spec = Spec(
             self.url(),
             self.fetcher(),
+            ImageStore('is', self.fetcher()),
             lambda x: x,
             lambda x: ApplyDOMFilters('NoEdit,NoFooter', x),
             PandocTexifier('pandoc'),
+            'margin=20mm',
             buf)
         paperdoorknob.process(spec)
         assert buf.getvalue() == b'''\\documentclass{article}
+\\usepackage[margin=20mm]{geometry}
 \\begin{document}
 This is glowfic
 You \\emph{sure}?
@@ -66,9 +70,11 @@ Pretty sure.
         spec = Spec(
             self.url(),
             self.fetcher(),
+            ImageStore('is', self.fetcher()),
             lambda x: x,
             lambda x: ApplyDOMFilters('NoEdit,NoFooter', x),
             texifier,
+            None,
             buf)
         paperdoorknob.process(spec)
 
@@ -77,9 +83,11 @@ Pretty sure.
             spec = Spec(
                 self.url(),
                 self.fetcher(),
+                ImageStore('is', self.fetcher()),
                 lambda x: x,
                 lambda x: ApplyDOMFilters('NoEdit,NoFooter', x),
                 PandocTexifier('pandoc'),
+                None,
                 out)
             paperdoorknob.process(spec)
         subprocess.run(['pdflatex', 'test.tex'],