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:
@@ -2,6 +2,7 @@ import os
|
||||
import tempfile
|
||||
import unittest
|
||||
from datetime import datetime, timedelta
|
||||
from unittest.mock import patch
|
||||
|
||||
from modules import app_sql
|
||||
|
||||
@@ -15,8 +16,15 @@ class TripSqlTest(unittest.TestCase):
|
||||
app_sql._last_trip_refresh = 0
|
||||
app_sql.sql_path = self.path
|
||||
self.conn = app_sql.get_conn()
|
||||
# refresh_trips() and build_trip_summaries() suppress trips until the
|
||||
# car ECU has been reached once (BUG-10 guard). 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()
|
||||
if app_sql._conn is not None:
|
||||
app_sql._conn.close()
|
||||
app_sql._conn = None
|
||||
|
||||
Reference in New Issue
Block a user