Fix tests
Python CI / test (push) Failing after 5m26s

This commit is contained in:
2025-09-12 21:23:56 +02:00
parent 65ab46556f
commit 718027f3c8
12 changed files with 58 additions and 39 deletions
+14
View File
@@ -50,7 +50,21 @@ class TestDocumentLayouter:
self.mock_concrete_style.word_spacing_min = 2.0
self.mock_concrete_style.word_spacing_max = 8.0
self.mock_concrete_style.text_align = "left"
# Create mock font that returns proper metrics
mock_font = Mock()
mock_font.getmetrics.return_value = (12, 4) # (ascent, descent)
mock_font.font = mock_font # For accessing .font property
self.mock_concrete_style.create_font = Mock()
# Update mock words to have proper style with font
for word in self.mock_words:
word.style = Mock()
word.style.font = mock_font
word.style.font_size = 16
word.style.colour = (0, 0, 0)
word.style.background = None
@patch('pyWebLayout.layout.document_layouter.ConcreteStyleRegistry')
@patch('pyWebLayout.layout.document_layouter.Line')