This commit is contained in:
parent
8dce1569c0
commit
ce7293824e
@ -416,8 +416,8 @@ class ContainerAware:
|
||||
"""
|
||||
if not hasattr(container, required_method):
|
||||
raise AttributeError(
|
||||
f"Container {
|
||||
type(container).__name__} must have a '{required_method}' method")
|
||||
f"Container {type(container).__name__} must have a '{required_method}' method"
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _inherit_style(cls, container, style=None):
|
||||
|
||||
@ -461,9 +461,8 @@ class EPUBReader:
|
||||
block._loaded_image = self.image_processor(block._loaded_image)
|
||||
except Exception as e:
|
||||
print(
|
||||
f"Warning: Image processing failed for image '{
|
||||
block.alt_text}': {
|
||||
str(e)}")
|
||||
f"Warning: Image processing failed for image '{block.alt_text}': {str(e)}"
|
||||
)
|
||||
# Continue with unprocessed image
|
||||
|
||||
def _process_content_images(self):
|
||||
|
||||
@ -81,8 +81,8 @@ class Font:
|
||||
logger.debug(f"Font loading: assets_dir = {assets_dir}")
|
||||
logger.debug(f"Font loading: bundled_font_path = {bundled_font_path}")
|
||||
logger.debug(
|
||||
f"Font loading: bundled font exists = {
|
||||
os.path.exists(bundled_font_path)}")
|
||||
f"Font loading: bundled font exists = {os.path.exists(bundled_font_path)}"
|
||||
)
|
||||
|
||||
if os.path.exists(bundled_font_path):
|
||||
logger.info(f"Found bundled font at: {bundled_font_path}")
|
||||
|
||||
@ -91,8 +91,8 @@ class TestLinkedWordHyphenation(unittest.TestCase):
|
||||
self.assertIsInstance(
|
||||
text_obj,
|
||||
LinkText,
|
||||
f"Hyphenated LinkedWord part should be LinkText, got {
|
||||
type(text_obj)}")
|
||||
f"Hyphenated LinkedWord part should be LinkText, got {type(text_obj)}"
|
||||
)
|
||||
self.assertEqual(text_obj.link.location, linked_word.location)
|
||||
|
||||
# The overflow should also be LinkText if it's hyphenated
|
||||
|
||||
@ -381,8 +381,8 @@ class TestEPUBReader(unittest.TestCase):
|
||||
# Each chapter should start with a heading
|
||||
first_block = blocks[0]
|
||||
self.assertIsInstance(
|
||||
first_block, Heading, f"Chapter {
|
||||
i + 1} should start with heading")
|
||||
first_block, Heading, f"Chapter {i + 1} should start with heading"
|
||||
)
|
||||
|
||||
def test_epub_styled_content(self):
|
||||
"""Test that styled content in EPUB is properly parsed."""
|
||||
|
||||
@ -51,8 +51,8 @@ class TestHTMLFileLoader(unittest.TestCase):
|
||||
self.assertIsInstance(
|
||||
block,
|
||||
Block,
|
||||
f"Item {i} should be a Block instance, got {
|
||||
type(block)}")
|
||||
f"Item {i} should be a Block instance, got {type(block)}"
|
||||
)
|
||||
|
||||
print(f"Successfully loaded and parsed HTML file with {len(blocks)} blocks")
|
||||
|
||||
|
||||
@ -335,10 +335,8 @@ class TestDocumentLayouterIntegration:
|
||||
line = test_page.children[0]
|
||||
min_spacing, max_spacing = line._spacing
|
||||
|
||||
assert min_spacing == case["expected_min"], f"Min constraint failed for {
|
||||
case['name']}"
|
||||
assert max_spacing == case["expected_max"], f"Max constraint failed for {
|
||||
case['name']}"
|
||||
assert min_spacing == case["expected_min"], f"Min constraint failed for {case['name']}"
|
||||
assert max_spacing == case["expected_max"], f"Max constraint failed for {case['name']}"
|
||||
|
||||
print(f"✓ {case['name']}: constraints ({min_spacing}, {max_spacing})")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user