papi/tests/utils.py

30 lines
896 B
Python

statuses = ("error", "warning", "pending", "ok")
def probe_sample_body(
*, channel_name: str = "Test channel", channel_id: int = -1, status: str = "ok"
):
if status not in statuses:
raise ValueError(f"{status} not in f{statuses}")
return {
"date": "2021-09-16T14:17:33.563Z",
"channels": [
{
"channelType": "fm",
"lastTimestamp": "2021-09-16T14:15:29.000Z",
"status": status,
"alarms": {
"noSignal": False,
"qualityIndexStatus": "warning",
"noWatermark": False,
"timestampDrift": True,
"unexpectedWatermark": False,
},
"name": channel_name,
"lastWatermarkId": 33336,
"id": channel_id,
},
],
}