#!/usr/bin/env python3 """Test script to verify imports work""" import sys import os # Test 1: Check if file exists transport_serial_path = 'lib/mpremote/transport_serial.py' print(f"1. Checking if {transport_serial_path} exists...") if os.path.exists(transport_serial_path): print(f" ✓ File exists ({os.path.getsize(transport_serial_path)} bytes)") else: print(f" ✗ File does NOT exist!") sys.exit(1) # Test 2: Add lib to path and import print("2. Testing imports...") sys.path.insert(0, 'lib') try: from mpremote.transport_serial import SerialTransport print(" ✓ transport_serial import works") except Exception as e: print(f" ✗ transport_serial import failed: {e}") sys.exit(1) # Test 3: Import device module try: import device print(" ✓ device module import works") except Exception as e: print(f" ✗ device module import failed: {e}") sys.exit(1) # Test 4: Import cli module try: import cli print(" ✓ cli module import works") except Exception as e: print(f" ✗ cli module import failed: {e}") import traceback traceback.print_exc() sys.exit(1) print("\n✓ All imports successful!")