@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user