auto flake and corrections

This commit is contained in:
2025-11-08 23:46:15 +01:00
parent 1ea870eef5
commit 781a9b6c08
81 changed files with 4646 additions and 3718 deletions
+14 -8
View File
@@ -48,7 +48,10 @@ class TestHTMLLinksInEreader(unittest.TestCase):
if isinstance(word, LinkedWord):
all_linked_words.append(word)
self.assertGreater(len(all_linked_words), 0, "Should create LinkedWords from HTML")
self.assertGreater(
len(all_linked_words),
0,
"Should create LinkedWords from HTML")
print(f"\n Created {len(all_linked_words)} LinkedWords from HTML")
# Step 2: Create EreaderLayoutManager (like the dreader app does)
@@ -91,17 +94,19 @@ class TestHTMLLinksInEreader(unittest.TestCase):
print(f" - '{elem['text']}' -> {elem['location']}")
# THIS IS THE KEY ASSERTION
self.assertGreater(len(interactive_elements), 0,
"Settings overlay should have interactive LinkText objects after rendering!")
self.assertGreater(
len(interactive_elements),
0,
"Settings overlay should have interactive LinkText objects after rendering!")
# Verify the expected links are present
locations = {elem['location'] for elem in interactive_elements}
self.assertIn("action:back_to_library", locations,
"Should find 'Back to Library' link")
"Should find 'Back to Library' link")
self.assertIn("setting:font_decrease", locations,
"Should find font decrease link")
"Should find font decrease link")
self.assertIn("setting:font_increase", locations,
"Should find font increase link")
"Should find font increase link")
def test_query_point_detects_links(self):
"""Test that query_point can detect LinkText objects."""
@@ -134,8 +139,9 @@ class TestHTMLLinksInEreader(unittest.TestCase):
if found_link:
break
self.assertTrue(found_link,
"Should be able to detect link via query_point somewhere on the page")
self.assertTrue(
found_link,
"Should be able to detect link via query_point somewhere on the page")
if __name__ == '__main__':