#!/usr/bin/env python3
# Test that nfsometer and its dependencies can be imported successfully
import sys

try:
    # Test importing the main package
    import nfsometerlib
    print("✓ nfsometerlib imported successfully")
    
    # Test importing the modules that use matplotlib
    from nfsometerlib import config
    print("✓ nfsometerlib.config imported successfully")
    
    from nfsometerlib import graph
    print("✓ nfsometerlib.graph imported successfully")
    
    from nfsometerlib import report
    print("✓ nfsometerlib.report imported successfully")
    
    from nfsometerlib import parse
    print("✓ nfsometerlib.parse imported successfully")
    
    from nfsometerlib import trace
    print("✓ nfsometerlib.trace imported successfully")
    
    from nfsometerlib import collection
    print("✓ nfsometerlib.collection imported successfully")
    
    # Test that matplotlib is available
    import matplotlib
    print("✓ matplotlib imported successfully")
    
    import matplotlib.pyplot
    print("✓ matplotlib.pyplot imported successfully")
    
    print("\nAll import tests passed!")
    sys.exit(0)
    
except ImportError as e:
    print(f"✗ Import failed: {e}", file=sys.stderr)
    sys.exit(1)
except Exception as e:
    print(f"✗ Unexpected error: {e}", file=sys.stderr)
    sys.exit(1)
