]> git.scottworley.com Git - paperdoorknob/commitdiff
Test bare chunks
authorScott Worley <scottworley@scottworley.com>
Fri, 26 Jan 2024 06:25:28 +0000 (22:25 -0800)
committerScott Worley <scottworley@scottworley.com>
Fri, 26 Jan 2024 06:25:28 +0000 (22:25 -0800)
glowfic_test.py

index bd26e3c9dfc5bc0ee4ec02eead21e34bdca42689..898aafba43c2c25a2b7e7f28c966d7e1ae5e6a0f 100644 (file)
@@ -88,6 +88,21 @@ class TestMakeChunk(unittest.TestCase):
         self.assertEqual(
             PandocTexifier("pandoc").texify(c.character), b'{Keltham}\n')
 
         self.assertEqual(
             PandocTexifier("pandoc").texify(c.character), b'{Keltham}\n')
 
+    def testMinimal(self) -> None:
+        t = Thread(spec_for_testing(b'''
+            <html><body>
+              <div class="post-container post-post">
+                <div class="post-content">Just content</div>
+              </div>
+            </body></html>'''))
+        c = makeChunk(next(iter(t.chunkDOMs())), FakeImageStore())
+        self.assertIsNone(c.icon)
+        self.assertIsNone(c.character)
+        self.assertIsNone(c.screen_name)
+        self.assertIsNone(c.author)
+        self.assertEqual(str(c.content),
+                         '<div class="post-content">Just content</div>')
+
 
 class TestThread(unittest.TestCase):
 
 
 class TestThread(unittest.TestCase):