Test configuration supporting variable lane sizes. Use lane_sizes for heterogeneous configurations (different LED count per lane). For uniform configurations, you can either: - Set lane_sizes = [100, 100, 100] (explicit) - Use TestConfig.uniform() factory method
| 34 | |
| 35 | @dataclass |
| 36 | class TestConfig: |
| 37 | """Test configuration supporting variable lane sizes. |
| 38 | |
| 39 | Use lane_sizes for heterogeneous configurations (different LED count per lane). |
| 40 | For uniform configurations, you can either: |
| 41 | - Set lane_sizes = [100, 100, 100] (explicit) |
| 42 | - Use TestConfig.uniform() factory method |
| 43 | """ |
| 44 | |
| 45 | driver: str |
| 46 | lane_sizes: list[int] # Per-lane LED counts, e.g., [300, 200, 100] |
| 47 | pattern: str |
| 48 | iterations: int = 1 |
| 49 | |
| 50 | # Runtime strip size configuration (fully dynamic) |
| 51 | short_strip_size: int | None = None # Short strip LED count (default: 100) |
| 52 | long_strip_size: int | None = None # Long strip LED count (default: 300) |
| 53 | test_small_strips: bool = True # Enable small strip testing |
| 54 | test_large_strips: bool = False # Enable large strip testing |
| 55 | |
| 56 | # Lane range configuration (NEW - Phase 6) |
| 57 | min_lanes: int | None = None # Minimum lane count for test matrix |
| 58 | max_lanes: int | None = None # Maximum lane count for test matrix |
| 59 | |
| 60 | @property |
| 61 | def lane_count(self) -> int: |
| 62 | """Number of lanes (derived from lane_sizes length).""" |
| 63 | return len(self.lane_sizes) |
| 64 | |
| 65 | @property |
| 66 | def total_leds(self) -> int: |
| 67 | """Total LED count across all lanes.""" |
| 68 | return sum(self.lane_sizes) |
| 69 | |
| 70 | @classmethod |
| 71 | def uniform( |
| 72 | cls, |
| 73 | driver: str, |
| 74 | led_count: int, |
| 75 | lane_count: int, |
| 76 | pattern: str, |
| 77 | iterations: int = 1, |
| 78 | ) -> "TestConfig": |
| 79 | """Create config with uniform lane sizes (all lanes same size).""" |
| 80 | return cls( |
| 81 | driver=driver, |
| 82 | lane_sizes=[led_count] * lane_count, |
| 83 | pattern=pattern, |
| 84 | iterations=iterations, |
| 85 | ) |
| 86 | |
| 87 | |
| 88 | @dataclass |
no outgoing calls
no test coverage detected