@@ -566,6 +566,91 @@ async def run(self):
566566 "Failed check should use current timestamp in mixed feed"
567567 )
568568
569+ @pytest .mark .asyncio
570+ async def test_get__rss_feed_description_includes_status (self , health_check_view ):
571+ """RSS feed item description includes status message."""
572+ feedparser = pytest .importorskip ("feedparser" )
573+
574+ class FailingBackend (HealthCheck ):
575+ async def run (self ):
576+ raise HealthCheckException ("Something went wrong" )
577+
578+ response = await health_check_view ([FailingBackend ], format_param = "rss" )
579+ feed = feedparser .parse (response .content .decode ("utf-8" ))
580+ assert len (feed .entries ) == 1
581+ entry = feed .entries [0 ]
582+ assert "Something went wrong" in entry .summary , (
583+ "Feed description should include the actual error message"
584+ )
585+
586+ @pytest .mark .asyncio
587+ async def test_get__rss_feed_description_healthy_shows_ok (self , health_check_view ):
588+ """RSS feed item description shows OK for healthy checks."""
589+ feedparser = pytest .importorskip ("feedparser" )
590+
591+ class SuccessBackend (HealthCheck ):
592+ async def run (self ):
593+ pass
594+
595+ response = await health_check_view ([SuccessBackend ], format_param = "rss" )
596+ feed = feedparser .parse (response .content .decode ("utf-8" ))
597+ assert len (feed .entries ) == 1
598+ entry = feed .entries [0 ]
599+ assert "OK" in entry .summary , (
600+ "Feed description should show OK for healthy checks"
601+ )
602+
603+ @pytest .mark .asyncio
604+ async def test_get__rss_feed_link_excludes_format_param (self , health_check_view ):
605+ """RSS feed item link does not include the format query parameter."""
606+ feedparser = pytest .importorskip ("feedparser" )
607+
608+ class SuccessBackend (HealthCheck ):
609+ async def run (self ):
610+ pass
611+
612+ response = await health_check_view ([SuccessBackend ], format_param = "rss" )
613+ feed = feedparser .parse (response .content .decode ("utf-8" ))
614+ assert len (feed .entries ) == 1
615+ entry = feed .entries [0 ]
616+ assert "format=rss" not in entry .link , (
617+ "Feed item link should not include the format query parameter"
618+ )
619+
620+ @pytest .mark .asyncio
621+ async def test_get__atom_feed_description_includes_status (self , health_check_view ):
622+ """Atom feed item description includes status message."""
623+ feedparser = pytest .importorskip ("feedparser" )
624+
625+ class FailingBackend (HealthCheck ):
626+ async def run (self ):
627+ raise HealthCheckException ("Database unreachable" )
628+
629+ response = await health_check_view ([FailingBackend ], format_param = "atom" )
630+ feed = feedparser .parse (response .content .decode ("utf-8" ))
631+ assert len (feed .entries ) == 1
632+ entry = feed .entries [0 ]
633+ assert "Database unreachable" in entry .summary , (
634+ "Feed description should include the actual error message"
635+ )
636+
637+ @pytest .mark .asyncio
638+ async def test_get__atom_feed_link_excludes_format_param (self , health_check_view ):
639+ """Atom feed item link does not include the format query parameter."""
640+ feedparser = pytest .importorskip ("feedparser" )
641+
642+ class SuccessBackend (HealthCheck ):
643+ async def run (self ):
644+ pass
645+
646+ response = await health_check_view ([SuccessBackend ], format_param = "atom" )
647+ feed = feedparser .parse (response .content .decode ("utf-8" ))
648+ assert len (feed .entries ) == 1
649+ entry = feed .entries [0 ]
650+ assert "format=atom" not in entry .link , (
651+ "Feed item link should not include the format query parameter"
652+ )
653+
569654 @pytest .mark .asyncio
570655 async def test_get_plugins__with_string_import (self ):
571656 """Import check from string path."""
0 commit comments