test: align suite with shipped behavior (WiFi swap, BUG-10 guard, odometer_baseline)
- test_app_trip + test_trip_sql: mock was_car_ever_connected() so trip building runs (BUG-10 guard suppresses trips until car ECU reached) - test_app_settings: include odometer_baseline in valid payload + assert save - test_yaris_uplink: Hotspot -> Hotspot-local; restore_fallback no longer activates AP (reports no_connection); wait timeout writes fallback_restored - test_app_network: local_hotspot mode removed by WiFi swap -> wifi/no-internet
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
import unittest
|
||||
from datetime import datetime, timedelta
|
||||
from unittest.mock import patch
|
||||
|
||||
from modules import app_trip
|
||||
|
||||
|
||||
class TripBuilderTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
# BUG-10 guard suppresses trips until the car ECU has been reached
|
||||
# once. Trip-building tests simulate a connected car.
|
||||
self._car_connected = patch(
|
||||
"modules.app_obd.was_car_ever_connected", return_value=True
|
||||
)
|
||||
self._car_connected.start()
|
||||
|
||||
def tearDown(self):
|
||||
self._car_connected.stop()
|
||||
|
||||
def rows_for_route(self, coordinates, speeds=None, start_id=1):
|
||||
started = datetime(2026, 1, 1, 8)
|
||||
speeds = speeds or [0] * len(coordinates)
|
||||
|
||||
Reference in New Issue
Block a user