Spaces:
Sleeping

studiq-backend / tests /test_offline_queue.py
StudIQ Auto Deploy Daemon
Auto deploy: Tue Oct 27 11:23:50 IST 2026
9f7b159
Raw History Blame Contribute Delete
548 Bytes
"""Unit tests for mobile offline message queue serialization."""
import json
import pytest
def test_offline_message_queue_serialization():
"""Verify offline messages serialize to JSON for local persistence."""
queue = [
{"temp_id": "t1", "content": "Question 1", "queued_at": 1700000000},
{"temp_id": "t2", "content": "Question 2", "queued_at": 1700000010},
]
serialized = json.dumps(queue)
deserialized = json.loads(serialized)
assert len(deserialized) == 2
assert deserialized[0]["temp_id"] == "t1"