McRogueFace/tests/unit/test_entity_constructor.py
John McCardle e5e796bad9 refactor: comprehensive test suite overhaul and demo system
Major changes:
- Reorganized tests/ into unit/, integration/, regression/, benchmarks/, demo/
- Deleted 73 failing/outdated tests, kept 126 passing tests (100% pass rate)
- Created demo system with 6 feature screens (Caption, Frame, Primitives, Grid, Animation, Color)
- Updated .gitignore to track tests/ directory
- Updated CLAUDE.md with comprehensive testing guidelines and API quick reference

Demo system features:
- Interactive menu navigation (press 1-6 for demos, ESC to return)
- Headless screenshot generation for CI
- Per-feature demonstration screens with code examples

Testing infrastructure:
- tests/run_tests.py - unified test runner with timeout support
- tests/demo/demo_main.py - interactive/headless demo runner
- All tests are headless-compliant

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 23:37:05 -05:00

27 lines
No EOL
807 B
Python

#!/usr/bin/env python3
import mcrfpy
# Create scene and grid
mcrfpy.createScene("test")
ui = mcrfpy.sceneUI("test")
# Create texture and grid
texture = mcrfpy.Texture("assets/kenney_TD_MR_IP.png", 16, 16)
grid = mcrfpy.Grid(5, 5, texture)
ui.append(grid)
# Test Entity constructor
try:
# Based on usage in ui_Grid_test.py
entity = mcrfpy.Entity(mcrfpy.Vector(2, 2), texture, 84, grid)
print("Entity created with 4 args: position, texture, sprite_index, grid")
except Exception as e:
print(f"4 args failed: {e}")
try:
# Maybe it's just position, texture, sprite_index
entity = mcrfpy.Entity((2, 2), texture, 84)
print("Entity created with 3 args: position, texture, sprite_index")
except Exception as e2:
print(f"3 args failed: {e2}")
mcrfpy.exit()