]> git.scottworley.com Git - paperdoorknob/blobdiff - paperdoorknob_test.py
Replies
[paperdoorknob] / paperdoorknob_test.py
index 83cf76ad4c9f17f7ac43150db9dbc3e62d7ea66e..7c486079818f73058a47e181de41eca4ef4e1e08 100644 (file)
@@ -33,6 +33,14 @@ class FakeGlowficHTTPRequestHandler(BaseHTTPRequestHandler):
     <div class="post-container post-post">
       This is glowfic
     </div>
+    <div class="flat-post-replies">
+      <div class="post-container post-reply">
+        You sure?
+      </div>
+      <div class="post-container post-reply">
+        Pretty sure.
+      </div>
+    </div>
   </body>
 </html>'''
         self.send_response(self._response_code())
@@ -92,6 +100,8 @@ class TestFetch(unittest.TestCase):
             post = paperdoorknob.Post(paperdoorknob.fetch(
                 f"http://localhost:{self._port()}", s, TIMEOUT))
             self.assertEqual(post.text().text.strip(), "This is glowfic")
+            self.assertEqual([r.text.strip() for r in post.replies()],
+                             ["You sure?", "Pretty sure."])
 
     def testFetchErrors(self) -> None:
         with requests.session() as s: