cluster4npu/tests/test_multidongle_start.py
HuangMason320 ccd7cdd6b9 feat: Reorganize test scripts and improve YOLOv5 postprocessing
- Move test scripts to tests/ directory for better organization
- Add improved YOLOv5 postprocessing with reference implementation
- Update gitignore to exclude *.mflow files and include main.spec
- Add debug capabilities and coordinate scaling improvements
- Enhance multi-series support with proper validation
- Add AGENTS.md documentation and example utilities

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 19:23:59 +08:00

49 lines
1.6 KiB
Python

#!/usr/bin/env python3
"""
Test MultiDongle start/stop functionality
"""
import sys
import os
current_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
def test_multidongle_start():
"""Test MultiDongle start method"""
try:
from core.functions.Multidongle import MultiDongle
# Test multi-series configuration
multi_series_config = {
"KL520": {"port_ids": [28, 32]},
"KL720": {"port_ids": [4]}
}
print("Creating MultiDongle with multi-series config...")
multidongle = MultiDongle(multi_series_config=multi_series_config)
print(f"Multi-series mode: {multidongle.multi_series_mode}")
print(f"Has _start_multi_series method: {hasattr(multidongle, '_start_multi_series')}")
print(f"Has _stop_multi_series method: {hasattr(multidongle, '_stop_multi_series')}")
print("MultiDongle created successfully!")
# Test that the required attributes exist
expected_attrs = ['send_threads', 'receive_threads', 'dispatcher_thread', 'result_ordering_thread']
for attr in expected_attrs:
if hasattr(multidongle, attr):
print(f"[OK] Has attribute: {attr}")
else:
print(f"[ERROR] Missing attribute: {attr}")
print("Test completed successfully!")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
test_multidongle_start()