X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/d6e27f4bb8ab56ca2545a72ab3433a12b1eb4a7f..refs/heads/main:/glowfic_test.py diff --git a/glowfic_test.py b/glowfic_test.py index befd0b5..d3fb2dd 100644 --- a/glowfic_test.py +++ b/glowfic_test.py @@ -4,6 +4,7 @@ # under the terms of the GNU General Public License as published by the # Free Software Foundation, version 3. +import dataclasses from io import BytesIO from sys import stderr import unittest @@ -164,6 +165,36 @@ class TestEmit(unittest.TestCase): \glowhead{}{}{}{}B ''') + def testEmitTwoThreads(self) -> None: + buf = BytesIO() + spec = dataclasses.replace(spec_for_testing(b'', buf), fetcher=FakeFetcher({ + 'https://fake/test': b''' +
+
Next Post »
+
''', + 'https://fake/test?view=flat': b''' +
A
+
+
B
+
+ ''', + 'https://fake/page2': b'''''', + 'https://fake/page2?view=flat': b''' +
C
+
+
D
+
E
+
+ ''', + })) + Thread(spec).emit() + self.assertEqual(buf.getvalue(), rb'''\glowhead{}{}{}{}A +\glowhead{}{}{}{}B +\glowhead{}{}{}{}C +\glowhead{}{}{}{}D +\glowhead{}{}{}{}E +''') + if __name__ == '__main__': unittest.main()