#!/usr/bin/env python3
"""Basic test of DryBox integrated protocol without UI"""

import sys
import time
from pathlib import Path

# Setup imports
sys.path.insert(0, str(Path(__file__).parent))
from integrated_protocol import IntegratedDryBoxProtocol

def test_protocol_creation():
    """Test creating protocol instances"""
    print("Testing protocol creation...")
    
    # Create sender
    sender = IntegratedDryBoxProtocol(mode="sender")
    print(f"✓ Sender created")
    print(f"  Identity: {sender.get_identity_key()[:32]}...")
    
    # Create receiver
    receiver = IntegratedDryBoxProtocol(mode="receiver")
    print(f"✓ Receiver created")
    print(f"  Identity: {receiver.get_identity_key()[:32]}...")
    
    # Show protocol info
    print(f"\nProtocol Information:")
    print(f"  Sender port: {sender.protocol.local_port}")
    print(f"  Receiver port: {receiver.protocol.local_port}")
    print(f"  Cipher support: AES-256-GCM, ChaCha20-Poly1305")
    print(f"  Voice codec: Codec2 @ 1200 bps")
    print(f"  Modulation: 4-FSK @ 600 baud")
    
    return True

if __name__ == "__main__":
    print("DryBox Basic Functionality Test")
    print("="*50)
    
    if test_protocol_creation():
        print("\n✓ All basic tests passed!")
        print("\nTo run the full system:")
        print("1. Start GSM simulator: python3 gsm_simulator.py")
        print("2. Run UI: python3 UI/integrated_ui.py")
        print("3. Or run CLI: python3 integrated_protocol.py [sender|receiver]")
    else:
        print("\n✗ Tests failed!")
        sys.exit(1)