Browse Source

Fix tautological assertion in SEO test

The assertion was checking 'has_seo_data or seo_data' inside an 'if seo_data:' block,
making it always truthy. Changed to just check 'has_seo_data' to properly verify
that expected SEO keys were extracted.

Co-authored-by: Nick Sweeting <[email protected]>
claude[bot] 1 month ago
parent
commit
08383c4d83
1 changed files with 1 additions and 1 deletions
  1. 1 1
      archivebox/plugins/seo/tests/test_seo.py

+ 1 - 1
archivebox/plugins/seo/tests/test_seo.py

@@ -123,7 +123,7 @@ class TestSEOWithChrome(TestCase):
                 if seo_data:
                     # Verify we got some SEO data
                     has_seo_data = any(key in seo_data for key in ['title', 'description', 'og:title', 'canonical', 'meta'])
-                    self.assertTrue(has_seo_data or seo_data, f"No SEO data extracted: {seo_data}")
+                    self.assertTrue(has_seo_data, f"No SEO data extracted: {seo_data}")
 
         except RuntimeError as e:
             if 'Chrome' in str(e) or 'CDP' in str(e):