McRogueFace/tests/unit/test_timer_legacy.py

26 lines
522 B
Python
Raw Normal View History

#!/usr/bin/env python3
"""
Test legacy timer API still works
"""
import mcrfpy
import sys
count = 0
def timer_callback(runtime):
global count
count += 1
print(f"Timer fired! Count: {count}, Runtime: {runtime}")
if count >= 3:
print("Test passed - timer fired 3 times")
sys.exit(0)
# Set up the scene
2026-01-03 10:59:52 -05:00
test_scene = mcrfpy.Scene("test_scene")
test_scene.activate()
# Create a timer the old way
mcrfpy.setTimer("test_timer", timer_callback, 100)
print("Legacy timer test starting...")