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>
This commit is contained in:
John McCardle 2025-12-29 19:47:48 -05:00
commit 9f481a2e4a
53 changed files with 614 additions and 586 deletions

View file

@ -10,10 +10,10 @@ import sys
# Create a derived Entity class
class CustomEntity(mcrfpy.Entity):
def __init__(self, x, y):
super().__init__(x, y)
def __init__(self, pos):
super().__init__(pos)
self.custom_attribute = "I am custom!"
def custom_method(self):
return "Custom method called"
@ -21,11 +21,11 @@ def run_test(runtime):
"""Test that derived entity classes maintain their type in collections"""
try:
# Create a grid
grid = mcrfpy.Grid(10, 10)
grid = mcrfpy.Grid(grid_size=(10, 10))
# Create instances of base and derived entities
base_entity = mcrfpy.Entity(1, 1)
custom_entity = CustomEntity(2, 2)
base_entity = mcrfpy.Entity((1, 1))
custom_entity = CustomEntity((2, 2))
# Add them to the grid's entity collection
grid.entities.append(base_entity)