Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
39 changes: 39 additions & 0 deletions research/visual_bge/tests/test_package_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Test that the visual_bge package can be properly imported."""

import sys
import importlib.util


def test_package_structure():
"""Test that visual_bge has proper package structure."""
import os
package_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
visual_bge_dir = os.path.join(package_dir, "visual_bge")

# Check that __init__.py exists in visual_bge directory
init_file = os.path.join(visual_bge_dir, "__init__.py")
assert os.path.exists(init_file), f"__init__.py should exist at {init_file}"

# Check that modeling.py exists
modeling_file = os.path.join(visual_bge_dir, "modeling.py")
assert os.path.exists(modeling_file), f"modeling.py should exist at {modeling_file}"


def test_import_visual_bge():
"""Test that visual_bge can be imported after installation."""
try:
# Try to import the module
import visual_bge
# Check that Visualized_BGE is accessible
assert hasattr(visual_bge, 'Visualized_BGE'), "Visualized_BGE should be importable from visual_bge"
except ImportError:
# If not installed, that's expected in test environment
# Just verify the package structure is correct
pass


if __name__ == "__main__":
test_package_structure()
print("Package structure test passed!")
test_import_visual_bge()
print("All tests passed!")