#!/usr/bin/env python3 """ Test script to validate that shared models work correctly. This script can be run to test model validation without dependencies. """ import sys import os # Add shared directory to path sys.path.append(os.path.dirname(os.path.abspath(__file__))) def test_models(): """Test shared models without external dependencies""" print("Testing shared models (syntax validation only)...") try: # Test that models can be imported from models import ( LobbyModel, SessionModel, ParticipantModel, WebSocketMessageModel, JoinStatusModel, UserJoinedModel, LobbyStateModel, UpdateModel, AddPeerModel, RemovePeerModel, SessionDescriptionModel, IceCandidateModel, ICECandidateDictModel, SessionDescriptionTypedModel, LobbyCreateRequest, LobbyCreateResponse, AdminActionResponse, HealthResponse, ) print("✓ All shared models imported successfully") # Test model definitions (without actually creating instances since we don't have pydantic) model_names = [ 'LobbyModel', 'SessionModel', 'ParticipantModel', 'WebSocketMessageModel', 'JoinStatusModel', 'UserJoinedModel', 'LobbyStateModel', 'UpdateModel', 'AddPeerModel', 'RemovePeerModel', 'SessionDescriptionModel', 'IceCandidateModel', 'ICECandidateDictModel', 'SessionDescriptionTypedModel', 'LobbyCreateRequest', 'LobbyCreateResponse', 'AdminActionResponse', 'HealthResponse' ] print(f"✓ {len(model_names)} models defined and accessible") print("✓ Shared models structure is valid") except Exception as e: print(f"✗ Error testing shared models: {e}") return False return True if __name__ == "__main__": success = test_models() sys.exit(0 if success else 1)