X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/53f396b459889b46e6feea48e8fa8e89b2452e9f..24b87badcef35a53477aec067ee61cc9dd97b2a5:/glowfic_test.py diff --git a/glowfic_test.py b/glowfic_test.py index 68debf9..bd26e3c 100644 --- a/glowfic_test.py +++ b/glowfic_test.py @@ -16,8 +16,9 @@ from texify import PandocTexifier def spec_for_testing(html: bytes) -> Spec: - return Spec('test', - FakeFetcher({'test': html, 'test?view=flat': html}), + return Spec('https://fake/test', + FakeFetcher({'https://fake/test': html, + 'https://fake/test?view=flat': html}), FakeImageStore(), lambda x: x, lambda x: None, @@ -102,7 +103,7 @@ class TestThread(unittest.TestCase): ''')) self.assertEqual(t.title(), 'Teh Story!') - def testNextThread(self) -> None: + def testNextThreadRelative(self) -> None: t = Thread(spec_for_testing(b'''
@@ -112,7 +113,19 @@ class TestThread(unittest.TestCase):
The "post"
''')) - self.assertEqual(t.next_thread(), '/posts/4567') + self.assertEqual(t.next_thread(), 'https://fake/posts/4567') + + def testNextThreadAbsolute(self) -> None: + t = Thread(spec_for_testing(b''' + +
+
Next Post »
+
« Previous Post
+
+
+
The "post"
+ ''')) + self.assertEqual(t.next_thread(), 'https://elsewhere/posts/4567') if __name__ == '__main__':