fix: preserve short release titles and cover source generation contracts
This commit is contained in:
@@ -101,3 +101,18 @@ def test_fetch_bad_record_does_not_discard_valid_siblings(monkeypatch):
|
||||
bad.text = None
|
||||
monkeypatch.setitem(feeds.ADAPTERS, "test_adapter", lambda source, n: [bad, good])
|
||||
assert feeds.fetch(src) == [good]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("title", ["GPT-5 launched", "Release 2.0", "v2.1.0"])
|
||||
def test_feed_keeps_short_release_titles(title):
|
||||
src = S("release_test", "models", "atom", "https://example.invalid/feed")
|
||||
row = feeds._item(src, "entry", "https://example.invalid/release", title,
|
||||
"Long description that must not replace the release title.")
|
||||
assert row.title == title
|
||||
|
||||
|
||||
def test_telegram_still_uses_body_for_empty_heading():
|
||||
src = S("tg_test", "security", "tg", "https://t.me/s/example", "tg_web")
|
||||
body = "An advisory with a meaningful first line."
|
||||
row = feeds._item(src, "post", "https://t.me/example/1", "...", body)
|
||||
assert row.title == body
|
||||
|
||||
Reference in New Issue
Block a user