from argparse import ArgumentParser
+import itertools
import os.path
from typing import Iterable
assert all(isinstance(r, Tag) for r in replies)
return replies
+ def entries(self) -> Iterable[Tag]:
+ return itertools.chain([self.text()], self.replies())
+
def command_line_parser() -> ArgumentParser:
parser = ArgumentParser(prog='paperdoorknob', description='Print glowfic')
self.assertEqual(post.text().text.strip(), "This is glowfic")
self.assertEqual([r.text.strip() for r in post.replies()],
["You sure?", "Pretty sure."])
+ self.assertEqual([r.text.strip() for r in post.entries()],
+ ["This is glowfic", "You sure?", "Pretty sure."])
def testFetchErrors(self) -> None:
with requests.session() as s: