diff --git a/tests/unit/test_title_render_consistency.py b/tests/unit/test_title_render_consistency.py index 801dc77fa..320be819f 100644 --- a/tests/unit/test_title_render_consistency.py +++ b/tests/unit/test_title_render_consistency.py @@ -54,7 +54,7 @@ class TestFontSizeCap: title_config=config, ) # 解析 Style 行的 Fontsize 字段(第3个字段,索引2) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] font_size = int(fields[2]) assert font_size == 36, f"字号60应被cap到36, 实际={font_size}" @@ -86,7 +86,7 @@ class TestBooleanStrokeNormalization: title_config=config, ) # 解析 Style 行的 Outline 字段(第17个字段,索引16) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] outline_width = float(fields[16]) assert outline_width == 2.0, f"stroke=true 应产生 outline_width=2, 实际={outline_width}" @@ -101,7 +101,7 @@ class TestBooleanStrokeNormalization: title_text="测试标题", title_config=config, ) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] outline_width = float(fields[16]) assert outline_width == 0.0, f"stroke=false 应产生 outline_width=0, 实际={outline_width}" @@ -116,7 +116,7 @@ class TestBooleanStrokeNormalization: title_text="测试标题", title_config=config, ) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] outline_width = float(fields[16]) assert outline_width == 3.0, f"自定义stroke width=3 应保留, 实际={outline_width}" @@ -135,7 +135,7 @@ class TestBooleanShadowNormalization: title_text="测试标题", title_config=config, ) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] # Shadow 字段是第18个(索引17) shadow_depth = int(fields[17]) @@ -151,7 +151,7 @@ class TestBooleanShadowNormalization: title_text="测试标题", title_config=config, ) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] shadow_depth = int(fields[17]) assert shadow_depth == 0, f"shadow=false 应产生 shadow_depth=0, 实际={shadow_depth}" @@ -166,7 +166,7 @@ class TestBooleanShadowNormalization: title_text="测试标题", title_config=config, ) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] shadow_depth = int(fields[17]) assert shadow_depth == 3, f"自定义shadow offset_y=3 应保留, 实际={shadow_depth}" @@ -198,7 +198,7 @@ class TestFullStyleConsistency: title_text="标题文本", title_config=config, ) - style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0] + style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0] fields = [f.strip() for f in style_line.split(",")] # Fontname