Loading files
7452d848cThis file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/hivehub-1225459033.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
"""Pure checks for the firmware/backend measurement-delivery id contract.
Run: cd server && python3 ../test-data/test_measurement_id.py
"""
from schemas import MeasurementIn
from measurements import measurement_insert_params
payload = MeasurementIn.model_validate(
{
"device_id": "hive-a",
"measurement_id": "a1b2c3d4-7-123",
"timestamp": "2026-07-23T12:00:00Z",
}
)
params = measurement_insert_params(payload, payload.timestamp)
assert payload.measurement_id == "a1b2c3d4-7-123"
assert params["measurement_id"] == payload.measurement_id
assert MeasurementIn.model_validate({"device_id": "legacy"}).measurement_id is None
print("Measurement id schema and insert mapping checks passed.")
7452d848cThis file is pinned to the selected release. Download the original to open it in your design tool.