# paperdoorknob: Print glowfic # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, version 3. import unittest from bs4 import BeautifulSoup from glowfic import chunkDOMs class TestSplit(unittest.TestCase): def testSplit1(self) -> None: soup = BeautifulSoup(b'''
The "post"
''', 'html.parser') self.assertEqual([list(t.stripped_strings) for t in chunkDOMs(soup)], [['The "post"']]) def testSplit2(self) -> None: soup = BeautifulSoup(b'''
The "post"
The "reply"
''', 'html.parser') self.assertEqual([list(t.stripped_strings) for t in chunkDOMs(soup)], [['The "post"'], ['The "reply"']]) def testSplit3(self) -> None: soup = BeautifulSoup(b'''
The "post"
1st reply
2nd reply
''', 'html.parser') self.assertEqual([list(t.stripped_strings) for t in chunkDOMs(soup)], [['The "post"'], ['1st reply'], ['2nd reply']]) if __name__ == '__main__': unittest.main()