""" tests/unit/test_bottleneck.py Unit tests for the BottleneckAlert dataclass. TDD: Red phase — tests written before implementation. """ import pytest from core.device.bottleneck import BottleneckAlert class TestBottleneckAlert: def test_fields_accessible(self): alert = BottleneckAlert( stage_id="stage-1", queue_fill_rate=0.85, suggested_action="Add more Dongles to this stage", severity="warning", ) assert alert.stage_id == "stage-1" assert alert.queue_fill_rate == 0.85 assert alert.suggested_action == "Add more Dongles to this stage" assert alert.severity == "warning" def test_severity_critical(self): alert = BottleneckAlert( stage_id="stage-2", queue_fill_rate=0.95, suggested_action="Urgent: add Dongles", severity="critical", ) assert alert.severity == "critical" def test_dataclass_equality(self): a = BottleneckAlert("s1", 0.9, "action", "warning") b = BottleneckAlert("s1", 0.9, "action", "warning") assert a == b def test_dataclass_inequality(self): a = BottleneckAlert("s1", 0.9, "action", "warning") b = BottleneckAlert("s1", 0.5, "action", "warning") assert a != b