Add trip history and route replay

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-09 19:48:06 -04:00
co-authored by Copilot
parent 3a981f5c6d
commit d3bc313e7f
13 changed files with 1158 additions and 25 deletions
+45
View File
@@ -0,0 +1,45 @@
import unittest
from modules import app_sql
class TrackingLoggerTest(unittest.TestCase):
def test_logs_first_fix(self):
self.assertTrue(
app_sql.should_log_tracking((45.5, -73.5), None, None, 0)
)
def test_does_not_persist_parked_five_second_samples(self):
self.assertFalse(
app_sql.should_log_tracking(
(45.500001, -73.5), 0, (45.5, -73.5), 5
)
)
def test_logs_fresh_obd_motion(self):
self.assertTrue(
app_sql.should_log_tracking(
(45.5, -73.5), 2, (45.5, -73.5), 5
)
)
def test_logs_accumulated_gps_motion_without_obd(self):
self.assertTrue(
app_sql.should_log_tracking(
(45.5001, -73.5), None, (45.5, -73.5), 10
)
)
def test_logs_stationary_heartbeat_after_one_minute(self):
self.assertTrue(
app_sql.should_log_tracking(
(45.5, -73.5),
0,
(45.5, -73.5),
app_sql.IDLE_LOG_INTERVAL,
)
)
if __name__ == "__main__":
unittest.main()