Refactor 11 more tests to mcrfpy.step() pattern

Converted from Timer-based async to step()-based sync:
- test_simple_callback.py
- test_empty_animation_manager.py
- test_frame_clipping.py
- test_frame_clipping_advanced.py
- test_grid_children.py
- test_color_helpers.py
- test_no_arg_constructors.py
- test_properties_quick.py
- test_simple_drawable.py
- test_python_object_cache.py
- WORKING_automation_test_example.py

Only 4 tests remain with Timer-based patterns (2 are headless detection
tests that may require special handling).

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

Co-Authored-By: Frack <frack@goblincorps.dev>
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Frick 2026-01-14 03:09:47 +00:00
commit be450286f8
12 changed files with 867 additions and 866 deletions

View file

@ -1,57 +1,67 @@
#!/usr/bin/env python3
"""Quick test of drawable properties"""
"""Quick test of drawable properties
Refactored to use mcrfpy.step() for synchronous execution.
"""
import mcrfpy
import sys
def test_properties(timer, runtime):
timer.stop()
print("\n=== Testing Properties ===")
# Test Frame
try:
frame = mcrfpy.Frame(pos=(10, 10), size=(100, 100))
print(f"Frame visible: {frame.visible}")
frame.visible = False
print(f"Frame visible after setting to False: {frame.visible}")
print(f"Frame opacity: {frame.opacity}")
frame.opacity = 0.5
print(f"Frame opacity after setting to 0.5: {frame.opacity}")
bounds = frame.get_bounds()
print(f"Frame bounds: {bounds}")
frame.move(5, 5)
bounds2 = frame.get_bounds()
print(f"Frame bounds after move(5,5): {bounds2}")
print("✓ Frame properties work!")
except Exception as e:
print(f"✗ Frame failed: {e}")
# Test Entity
try:
entity = mcrfpy.Entity()
print(f"\nEntity visible: {entity.visible}")
entity.visible = False
print(f"Entity visible after setting to False: {entity.visible}")
print(f"Entity opacity: {entity.opacity}")
entity.opacity = 0.7
print(f"Entity opacity after setting to 0.7: {entity.opacity}")
bounds = entity.get_bounds()
print(f"Entity bounds: {bounds}")
entity.move(3, 3)
print(f"Entity position after move(3,3): ({entity.x}, {entity.y})")
print("✓ Entity properties work!")
except Exception as e:
print(f"✗ Entity failed: {e}")
sys.exit(0)
# Initialize scene
test = mcrfpy.Scene("test")
test_properties_timer = mcrfpy.Timer("test_properties", test_properties, 100, once=True)
test.activate()
mcrfpy.step(0.01)
print("\n=== Testing Properties ===")
all_pass = True
# Test Frame
try:
frame = mcrfpy.Frame(pos=(10, 10), size=(100, 100))
print(f"Frame visible: {frame.visible}")
frame.visible = False
print(f"Frame visible after setting to False: {frame.visible}")
print(f"Frame opacity: {frame.opacity}")
frame.opacity = 0.5
print(f"Frame opacity after setting to 0.5: {frame.opacity}")
bounds = frame.get_bounds()
print(f"Frame bounds: {bounds}")
frame.move(5, 5)
bounds2 = frame.get_bounds()
print(f"Frame bounds after move(5,5): {bounds2}")
print("+ Frame properties work!")
except Exception as e:
print(f"x Frame failed: {e}")
all_pass = False
# Test Entity
try:
entity = mcrfpy.Entity()
print(f"\nEntity visible: {entity.visible}")
entity.visible = False
print(f"Entity visible after setting to False: {entity.visible}")
print(f"Entity opacity: {entity.opacity}")
entity.opacity = 0.7
print(f"Entity opacity after setting to 0.7: {entity.opacity}")
bounds = entity.get_bounds()
print(f"Entity bounds: {bounds}")
entity.move(3, 3)
print(f"Entity position after move(3,3): ({entity.x}, {entity.y})")
print("+ Entity properties work!")
except Exception as e:
print(f"x Entity failed: {e}")
all_pass = False
if all_pass:
print("\nPASS")
sys.exit(0)
else:
print("\nFAIL")
sys.exit(1)