+class BaseTestProcess(ABC):
+
+ @abstractmethod
+ def url(self) -> str:
+ raise NotImplementedError()
+
+ @abstractmethod
+ def fetcher(self) -> Fetcher:
+ raise NotImplementedError()
+
+ def testReplies(self) -> None:
+ replies = paperdoorknob.replies(
+ paperdoorknob.clean(
+ paperdoorknob.parse(
+ self.fetcher().fetch(
+ self.url()))))
+ assert [r.text.strip() for r in replies] == [
+ "This is glowfic",
+ "You sure?",
+ "Pretty sure."]
+
+ def testProcess(self) -> None:
+ buf = io.BytesIO()
+ spec = Spec(
+ self.url(),
+ self.fetcher(),
+ lambda x: x,
+ PandocTexifier('pandoc'),
+ buf)
+ paperdoorknob.process(spec)
+ assert buf.getvalue() == b'''\\documentclass{article}
+\\begin{document}
+This is glowfic
+You \\emph{sure}?
+Pretty sure.
+\\end{document}
+'''