]> git.scottworley.com Git - paperdoorknob/blobdiff - glowfic_test.py
Optionally have Thread.__init__ fetch the HTML
[paperdoorknob] / glowfic_test.py
index ed32945d50f1bcce42f507346146761c9a029468..64da1649b1209b2bb5b37f914e6f40f65aae89b7 100644 (file)
@@ -72,5 +72,20 @@ class TestMakeChunk(unittest.TestCase):
             PandocTexifier("pandoc").texify(c.character), b'{Keltham}\n')
 
 
+class TestThread(unittest.TestCase):
+
+    def testTitle(self) -> None:
+        t = Thread(BeautifulSoup(b'''
+            <html><body>
+              <div class="content-header">
+                <span id="post-title">
+                  <a href="/posts/1234">Teh Story!</a>
+                </span>
+              </div>
+              <div class="post-container post-post">The "post"</div>
+            </body></html>''', 'html.parser'))
+        self.assertEqual(t.title(), 'Teh Story!')
+
+
 if __name__ == '__main__':
     unittest.main()