Download backend/tests/test_compressor.py from interactAi-inc/Pit-Lane-Project: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/interactAi-inc/Pit-Lane-Project/resolve/main/backend/tests/test_compressor.py
- Command line
-
hf download hf://interactAi-inc/Pit-Lane-Project/backend/tests/test_compressor.py
-
curl -L -o test_compressor.py https://huggingface.co/interactAi-inc/Pit-Lane-Project/resolve/main/backend/tests/test_compressor.py
1.15 kB
| from app.services.live_compressor import LiveLapCompressor | |
| def test_compressor_uses_declared_aggregations_and_missing_rules(): | |
| compressed = LiveLapCompressor().compress( | |
| [ | |
| { | |
| "Date": "2025-05-04T12:00:00Z", | |
| "Driver": "ver", | |
| "LapNumber": 2, | |
| "RPM": 10_000, | |
| "DifferentialDistance": 1.5, | |
| "Rainfall": 0, | |
| "Compound": "MEDIUM", | |
| }, | |
| { | |
| "Date": "2025-05-04T12:01:00Z", | |
| "Driver": "ver", | |
| "LapNumber": 2, | |
| "RPM": float("nan"), | |
| "DifferentialDistance": 2.5, | |
| "Rainfall": 1, | |
| "Compound": None, | |
| }, | |
| ] | |
| ) | |
| assert compressed["RPM_Mean"] == 10_000 | |
| assert compressed["Speed_Mean"] is None | |
| assert compressed["DifferentialDistance_Sum"] == 4.0 | |
| assert compressed["Rainfall_Any"] == 1.0 | |
| assert compressed["Compound_Last"] == "MEDIUM" | |
| assert compressed["Driver"] == "VER" | |
| assert compressed["_RaceDate"] == "2025-05-04" | |