fleet-platform/tests/fixtures/jimi_payloads.py
kianiadee 13a4c17d80
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
Parser: tolerate real Tracksolid wire shape (imei/speed names, null gpsTime for offline devices) + per-item resilience
2026-05-23 09:05:17 +03:00

115 lines
2.7 KiB
Python

"""Synthetic Tracksolid wire payloads.
These match the field names Tracksolid sends on the wire. Real sandbox-account
fixtures will replace these in week 1 day 1 (see Phase-1 plan, week 2 step 1).
"""
PUSH_GPS_SINGLE = {
"deviceImei": "860112050000001",
"gpsTime": "2026-05-22 12:34:56",
"lat": -1.2864,
"lng": 36.8172,
"gpsSpeed": 42.5,
"direction": 90,
"acc": "1",
"satelliteNum": 12,
"altitude": 1795.0,
"postType": 0,
}
PUSH_ALARM_SINGLE = {
"imei": "860112050000001",
"alarmType": "panic",
"alarmName": "Panic button",
"alarmTime": "2026-05-22 12:35:10",
"lat": -1.2864,
"lng": 36.8172,
"speed": 0.0,
"deviceName": "FRSD-001",
}
PUSH_HEARTBEAT_SINGLE = {
"deviceImei": "860112050000001",
"gateTime": "2026-05-22 12:30:00",
"powerLevel": 88,
"gsmSign": 27,
"acc": 1,
"powerStatus": 1,
}
PUSH_EVENT_LOGIN = {
"deviceImei": "860112050000001",
"type": "LOGIN",
"gateTime": "2026-05-22 07:00:00",
"timezone": "+03:00",
}
POLL_LOCATION_LIST_RESPONSE = {
"_list": [
{
"deviceImei": "860112050000001",
"gpsTime": "2026-05-22 12:34:56",
"lat": -1.2864,
"lng": 36.8172,
"gpsSpeed": 42.5,
"direction": 90,
"satelliteNum": 12,
},
{
"deviceImei": "860112050000002",
"gpsTime": "2026-05-22 12:34:50",
"lat": -0.3476,
"lng": 32.5825,
"gpsSpeed": 0.0,
"direction": 0,
"satelliteNum": 9,
},
]
}
# Real Tracksolid Pro API response — production field names + offline device shape
TRACKSOLID_POLL_LIST_REAL = {
"code": 0,
"msg": None,
"data": None,
"message": None,
"result": [
{
"imei": "862798052792732",
"deviceName": "JC400P-92732",
"mcType": "JC400P",
"lat": 0.0,
"lng": 0.0,
"gpsTime": None,
"speed": None,
"direction": None,
"gpsNum": None,
"accStatus": "0",
"status": "0",
"posType": None,
},
{
"imei": "868000000000123",
"deviceName": "GT06E-00123",
"mcType": "GT06E",
"lat": -1.2864,
"lng": 36.8172,
"gpsTime": "2026-05-23 06:00:00",
"speed": 42.5,
"direction": 90,
"gpsNum": 12,
"accStatus": "1",
"status": "1",
"posType": "GPS",
},
],
}
ZERO_ISLAND_FIX = {
"deviceImei": "860112050000001",
"gpsTime": "2026-05-22 12:00:00",
"lat": 0.0,
"lng": 0.0,
"gpsSpeed": 0.0,
}