+class BaseTestProcess(ABC):
+
+ @abstractmethod
+ def url(self) -> str:
+ raise NotImplementedError()
+
+ @abstractmethod
+ def fetcher(self) -> Fetcher:
+ raise NotImplementedError()
+
+ def testProcess(self) -> None:
+ buf = io.BytesIO()
+ texifier = PandocTexifier('pandoc')
+ spec = Spec(
+ self.url(),
+ self.fetcher(),
+ FakeImageStore(),
+ lambda x: x,
+ lambda x: None,
+ texifier,
+ lambda x: x,
+ 20,
+ ContentOnlyLayout,
+ 'margin=20mm',
+ buf,
+ lambda _: None)
+ paperdoorknob.process(spec)
+ assert re.match(br'''\\documentclass{article}
+(\\usepackage{[a-z]+}\n)+\\usepackage\[margin=20mm\]{geometry}
+\\begin{document}
+(.|\n)*
+\\glowhead{}{}{}{}This is \\href{https://glowfic.com}{glowfic}
+\\glowhead{}{}{}{}You \\emph{sure}\?
+\\glowhead{}{}{}{}Pretty sure.
+\\end{document}
+''', buf.getvalue())
+
+ def testDirectTexifier(self) -> None:
+ texifier = VerifyingTexifier(
+ PandocTexifier('pandoc'), DirectTexifier())
+ buf = io.BytesIO()
+ spec = Spec(
+ self.url(),
+ self.fetcher(),
+ FakeImageStore(),
+ lambda x: x,
+ lambda x: None,
+ texifier,
+ lambda x: x,
+ 20,
+ ContentOnlyLayout,
+ None,
+ buf,
+ lambda _: None)
+ paperdoorknob.process(spec)