release: ship validated Mentor PDF exporter v1.0.0
This commit is contained in:
1 parent
d4928af5b6
commit
0334f2b85b
50 files changed
+3998
-219
No files matched your search
@@ -31,3 +31,31 @@ def test_stroke_mode_uses_native_verified_attached_switch():
|
||||
args=build_command(Path("engine.exe"),Path("a.prj"),Path("a.pdf"),ExportOptions(stroke_fonts=True))
|
||||
assert "-uAll" in args
|
||||
assert "-u" not in args and "-udx" not in args
|
||||
|
||||
|
||||
def test_explicit_font_and_print_profile_modes():
|
||||
options=ExportOptions(font_mapping="arial",print_theme="high_contrast")
|
||||
assert options.font_mapping=="arial" and options.print_theme=="high_contrast"
|
||||
|
||||
|
||||
def test_profile_modes_reject_unknown_names():
|
||||
import pytest
|
||||
with pytest.raises(ValueError,match="字体"):
|
||||
ExportOptions(font_mapping="arail\nInjected value")
|
||||
with pytest.raises(ValueError,match="配色"):
|
||||
ExportOptions(print_theme="unknown")
|
||||
|
||||
|
||||
def test_arial_profile_changes_only_copy_font_configuration(tmp_path):
|
||||
ini=tmp_path/"dxpdf.ini";ini.write_text("FONT_CUSTOM_FONTS Courier-Bold\nFont_1 Courier-Bold\n")
|
||||
write_profile(ini,ExportOptions(font_mapping="arial"))
|
||||
lines=ini.read_text().splitlines()
|
||||
assert "FONT_CUSTOM_FONTS Arial" in lines
|
||||
assert "Font_1 Arial" in lines
|
||||
|
||||
|
||||
def test_print_theme_controls_effective_background_mode():
|
||||
args=build_command(Path("engine.exe"),Path("p.prj"),Path("p.pdf"),ExportOptions(color=2,print_theme="high_contrast"))
|
||||
assert args[args.index("-c")+1]=="4"
|
||||
args=build_command(Path("engine.exe"),Path("p.prj"),Path("p.pdf"),ExportOptions(print_theme="mono"))
|
||||
assert args[args.index("-c")+1]=="3"
|
||||
Reference in new issue
Block a user