McRogueFace/tests/unit/test_animation_immediate.py
John McCardle 9f481a2e4a fix: Update test files to use current API patterns
Migrates test suite to current API:
- Frame(x, y, w, h) → Frame(pos=(x, y), size=(w, h))
- Caption("text", x, y) → Caption(pos=(x, y), text="text")
- caption.size → caption.font_size
- Entity(x, y, ...) → Entity((x, y), ...)
- Grid(w, h, ...) → Grid(grid_size=(w, h), ...)
- cell.color → ColorLayer system

Tests now serve as valid API usage examples.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 19:47:48 -05:00

33 lines
No EOL
757 B
Python

#!/usr/bin/env python3
"""
Test Animation creation without timer
"""
import mcrfpy
print("1. Creating scene...")
mcrfpy.createScene("test")
mcrfpy.setScene("test")
print("2. Getting UI...")
ui = mcrfpy.sceneUI("test")
print("3. Creating frame...")
frame = mcrfpy.Frame(pos=(100, 100), size=(200, 200))
ui.append(frame)
print("4. Creating Animation object...")
try:
anim = mcrfpy.Animation("x", 500.0, 2000, "easeInOut")
print("5. Animation created successfully!")
except Exception as e:
print(f"5. Animation creation failed: {e}")
print("6. Starting animation...")
try:
anim.start(frame)
print("7. Animation started!")
except Exception as e:
print(f"7. Animation start failed: {e}")
print("8. Script completed without crash!")