| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #!/usr/bin/env python3
- """
- Test script to verify that USM autoprovides command no longer has a timeout.
- """
- import sys
- import time
- from pathlib import Path
- # Add the src directory to the path so we can import autusm
- sys.path.insert(0, str(Path(__file__).parent / "src"))
- from autusm.usm_integration import USMIntegration
- def test_no_timeout():
- """Test that autoprovides can run without timeout."""
- print("Testing USM autoprovides without timeout...")
-
- # Initialize USM integration
- usm = USMIntegration()
-
- # Check if USM is available
- if not usm.is_available():
- print("USM is not available on this system. Skipping test.")
- return True
-
- print("USM is available. Testing autoprovides without timeout...")
-
- # Try to get autoprovides for the current directory
- # This will test if the timeout has been removed
- try:
- start_time = time.time()
- autoprovides = usm.get_autoprovides(Path.cwd())
- end_time = time.time()
-
- elapsed_time = end_time - start_time
- print(f"Autoprovides completed in {elapsed_time:.2f} seconds")
- print(f"Found {len(autoprovides)} autoprovides")
-
- # If we get here without a timeout error, the test passes
- print("SUCCESS: No timeout occurred!")
- return True
-
- except Exception as e:
- print(f"ERROR: {e}")
- return False
- if __name__ == "__main__":
- success = test_no_timeout()
- sys.exit(0 if success else 1)
|