| 1 |
#!/usr/bin/env python3 |
| 2 |
# Test that nfsometer and its dependencies can be imported successfully |
| 3 |
import sys |
| 4 |
|
| 5 |
try: |
| 6 |
# Test importing the main package |
| 7 |
import nfsometerlib |
| 8 |
print("✓ nfsometerlib imported successfully") |
| 9 |
|
| 10 |
# Test importing the modules that use matplotlib |
| 11 |
from nfsometerlib import config |
| 12 |
print("✓ nfsometerlib.config imported successfully") |
| 13 |
|
| 14 |
from nfsometerlib import graph |
| 15 |
print("✓ nfsometerlib.graph imported successfully") |
| 16 |
|
| 17 |
from nfsometerlib import report |
| 18 |
print("✓ nfsometerlib.report imported successfully") |
| 19 |
|
| 20 |
from nfsometerlib import parse |
| 21 |
print("✓ nfsometerlib.parse imported successfully") |
| 22 |
|
| 23 |
from nfsometerlib import trace |
| 24 |
print("✓ nfsometerlib.trace imported successfully") |
| 25 |
|
| 26 |
from nfsometerlib import collection |
| 27 |
print("✓ nfsometerlib.collection imported successfully") |
| 28 |
|
| 29 |
# Test that matplotlib is available |
| 30 |
import matplotlib |
| 31 |
print("✓ matplotlib imported successfully") |
| 32 |
|
| 33 |
import matplotlib.pyplot |
| 34 |
print("✓ matplotlib.pyplot imported successfully") |
| 35 |
|
| 36 |
print("\nAll import tests passed!") |
| 37 |
sys.exit(0) |
| 38 |
|
| 39 |
except ImportError as e: |
| 40 |
print(f"✗ Import failed: {e}", file=sys.stderr) |
| 41 |
sys.exit(1) |
| 42 |
except Exception as e: |
| 43 |
print(f"✗ Unexpected error: {e}", file=sys.stderr) |
| 44 |
sys.exit(1) |