1
0
Files
PPTX/tests/fixtures/templates/complex/title-slide-complex.yaml
lanyuanxiaoyao ab2510a400 test: add comprehensive pytest test suite
Add complete test infrastructure for yaml2pptx project with 245+ tests
covering unit, integration, and end-to-end scenarios.

Test structure:
- Unit tests: elements, template system, validators, loaders, utils
- Integration tests: presentation and rendering flows
- E2E tests: CLI commands (convert, check, preview)

Key features:
- PptxFileValidator for Level 2 PPTX validation (file structure,
  element count, content matching, position tolerance)
- Comprehensive fixtures for test data consistency
- Mock-based testing for external dependencies
- Test images generated with PIL/Pillow
- Boundary case coverage for edge scenarios

Dependencies added:
- pytest, pytest-cov, pytest-mock
- pillow (for test image generation)

Documentation updated:
- README.md: test running instructions
- README_DEV.md: test development guide

Co-authored-by: OpenSpec change: add-comprehensive-tests
2026-03-02 23:11:34 +08:00

60 lines
1015 B
YAML

vars:
- name: title
required: true
- name: subtitle
required: false
default: ""
- name: author
required: false
default: ""
- name: date
required: false
default: ""
elements:
# 标题
- type: shape
box: [0, 0, 10, 5.625]
shape: rectangle
fill: "#4a90e2"
# 标题文本
- type: text
box: [1, 1.5, 8, 1]
content: "{title}"
font:
size: 44
bold: true
color: "#ffffff"
align: center
# 副标题(条件显示)
- type: text
box: [1, 2.8, 8, 0.6]
content: "{subtitle}"
visible: "{subtitle != ''}"
font:
size: 24
color: "#ffffff"
align: center
# 作者
- type: text
box: [1, 4, 8, 0.5]
content: "{author}"
visible: "{author != ''}"
font:
size: 18
color: "#e0e0e0"
align: center
# 日期
- type: text
box: [1, 4.8, 8, 0.4]
content: "{date}"
visible: "{date != ''}"
font:
size: 14
color: "#cccccc"
align: center