return parser
-def fetch(url: str, fetcher: Fetcher) -> BeautifulSoup:
- return BeautifulSoup(fetcher.fetch(url), 'html.parser')
+def parse(content: bytes) -> BeautifulSoup:
+ return BeautifulSoup(content, 'html.parser')
def clean(html: BeautifulSoup) -> BeautifulSoup:
texout: IO[bytes],
pandoc: str) -> None:
texout.write(b'\\documentclass{article}\n\\begin{document}\n')
- html = clean(fetch(url, fetcher))
+ html = clean(parse(fetcher.fetch(url)))
for r in replies(html):
texout.write(html_to_tex(pandoc, r))
texout.write(b'\\end{document}\n')
with DirectFetcher(TIMEOUT) as f:
replies = paperdoorknob.replies(
paperdoorknob.clean(
- paperdoorknob.fetch(f"http://localhost:{self._port}", f)))
+ paperdoorknob.parse(
+ f.fetch(f"http://localhost:{self._port}"))))
self.assertEqual([r.text.strip() for r in replies],
["This is glowfic", "You sure?", "Pretty sure."])