McRogueFace/tests/unit/test_simple_drawable.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

30 lines
No EOL
761 B
Python

#!/usr/bin/env python3
"""Simple test to isolate drawable issue"""
import mcrfpy
import sys
def simple_test(runtime):
mcrfpy.delTimer("simple_test")
try:
# Test basic functionality
frame = mcrfpy.Frame(pos=(10, 10), size=(100, 100))
print(f"Frame created: visible={frame.visible}, opacity={frame.opacity}")
bounds = frame.get_bounds()
print(f"Bounds: {bounds}")
frame.move(5, 5)
print("Move completed")
frame.resize(150, 150)
print("Resize completed")
print("PASS - No crash!")
except Exception as e:
print(f"ERROR: {e}")
sys.exit(0)
mcrfpy.createScene("test")
mcrfpy.setTimer("simple_test", simple_test, 100)