diff tests/test_format.py @ 48:486affad656e

Rewrite posting process with card system and more structured API - The basic posting process is more opinionated so that silos have less code to write, and dry-run posting is handled by default. - Add "card" system where SiloRider is able to fetch the page of a post to check for any custom summary or featured image. This is how Twitter, Facebook, Discord, and many others come up with their "preview card" when a link is posted.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 08 Oct 2023 13:47:28 -0700
parents 9e4eb3f2754e
children
line wrap: on
line diff
--- a/tests/test_format.py	Sun Oct 08 13:38:08 2023 -0700
+++ b/tests/test_format.py	Sun Oct 08 13:47:28 2023 -0700
@@ -81,10 +81,10 @@
      'words in it for no good reason', 80, True,
      'A test entry that is very very long because its... ' + test_url)
 ])
-def test_format_lonform_entry(title, limit, add_url, expected):
+def test_format_longform_entry(title, limit, add_url, expected):
     entry = _make_test_entry(title, False)
-    actual = format_entry(entry, limit, add_url)
-    assert actual == expected
+    actual = format_entry(entry, limit=limit, add_url=add_url)
+    assert actual.text == expected
 
 
 @pytest.mark.parametrize("text, limit, add_url, expected", [
@@ -109,5 +109,5 @@
 ])
 def test_format_micropost_entry(text, limit, add_url, expected):
     entry = _make_test_entry(text, True)
-    actual = format_entry(entry, limit, add_url)
-    assert actual == expected
+    actual = format_entry(entry, limit=limit, add_url=add_url)
+    assert actual.text == expected