Spaces:
Sleeping
Sleeping
Download tests/test_offline_queue.py from baljot07/studiq-backend: direct link, hf CLI and curl.
- Browser
- Download file 548 Bytes
-
https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_offline_queue.py
- Command line
-
hf download hf://spaces/baljot07/studiq-backend/tests/test_offline_queue.py
-
curl -L -o test_offline_queue.py https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_offline_queue.py
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" | |