Organize test suite: add README, move loose tests to proper directories
- Add tests/README.md documenting test structure and usage - Move issue_*_test.py files to tests/regression/ (9 files) - Move loose test_*.py files to tests/unit/ (18 files) - tests/ root now contains only pytest infrastructure Addresses #166 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a4217b49d7
commit
165db91b8d
28 changed files with 174 additions and 0 deletions
|
|
@ -1,61 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Test module namespace changes (#184, #189)"""
|
||||
import sys
|
||||
import mcrfpy
|
||||
|
||||
print("Testing module namespace changes (#184, #189)...")
|
||||
|
||||
# Test window singleton exists (#184)
|
||||
print("Testing window singleton...")
|
||||
if not hasattr(mcrfpy, 'window'):
|
||||
print("FAIL: mcrfpy.window should exist")
|
||||
sys.exit(1)
|
||||
|
||||
window = mcrfpy.window
|
||||
if window is None:
|
||||
print("FAIL: window should not be None")
|
||||
sys.exit(1)
|
||||
|
||||
# Verify window properties
|
||||
if not hasattr(window, 'resolution'):
|
||||
print("FAIL: window should have resolution property")
|
||||
sys.exit(1)
|
||||
|
||||
print(f" window exists: {window}")
|
||||
print(f" window.resolution: {window.resolution}")
|
||||
|
||||
# Test that internal types are hidden from module namespace (#189)
|
||||
print("Testing hidden internal types...")
|
||||
hidden_types = ['UICollectionIter', 'UIEntityCollectionIter', 'GridPoint', 'GridPointState']
|
||||
visible = []
|
||||
for name in hidden_types:
|
||||
if hasattr(mcrfpy, name):
|
||||
visible.append(name)
|
||||
|
||||
if visible:
|
||||
print(f"FAIL: These types should be hidden from module namespace: {visible}")
|
||||
# Note: This is a soft fail - if these are expected to be visible, adjust the test
|
||||
# sys.exit(1)
|
||||
else:
|
||||
print(" All internal types are hidden from module namespace")
|
||||
|
||||
# But iteration should still work - test UICollection iteration
|
||||
print("Testing that iteration still works...")
|
||||
scene = mcrfpy.Scene("test_scene")
|
||||
ui = scene.children
|
||||
ui.append(mcrfpy.Frame(pos=(0,0), size=(50,50)))
|
||||
ui.append(mcrfpy.Caption(text="hi", pos=(0,0)))
|
||||
|
||||
count = 0
|
||||
for item in ui:
|
||||
count += 1
|
||||
print(f" Iterated item: {item}")
|
||||
|
||||
if count != 2:
|
||||
print(f"FAIL: Should iterate over 2 items, got {count}")
|
||||
sys.exit(1)
|
||||
|
||||
print(" Iteration works correctly")
|
||||
|
||||
print("PASS: Module namespace changes work correctly!")
|
||||
sys.exit(0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue