]> git.scottworley.com Git - paperdoorknob/blobdiff - paperdoorknob_test.py
Parse HTML
[paperdoorknob] / paperdoorknob_test.py
index cb70ac56dd214d26988a86e915aea762cb74008b..ab13eedf9730acccb9ec2b0f8ec64fc9c02ce016 100644 (file)
@@ -81,6 +81,14 @@ class TestFetch(unittest.TestCase):
             paperdoorknob.fetch(f"http://localhost:{self._port()}", s, TIMEOUT)
             self.assertEqual(self._request_counter, 1)
 
+    def testFetchConents(self) -> None:
+        with requests.session() as s:
+            doc = paperdoorknob.fetch(
+                f"http://localhost:{self._port()}", s, TIMEOUT)
+            body = doc.body
+            assert body
+            self.assertEqual(body.text, "This is glowfic")
+
     def testFetchErrors(self) -> None:
         with requests.session() as s:
             with self.assertRaises(requests.HTTPError):