16 lines
597 B
Python
16 lines
597 B
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
from devplacepy.services.sync.spec import SPEC
|
|
|
|
|
|
def test_spec_is_public_and_matches_code(client):
|
|
response = client.get("/sync/spec.json")
|
|
assert response.status_code == 200
|
|
body = response.json()
|
|
assert body["kinds"] == list(SPEC.kinds)
|
|
assert body["statuses"] == list(SPEC.statuses)
|
|
assert body["limits"]["max_batch_records"] == SPEC.limits.max_batch_records
|
|
assert set(body["records"]) == set(SPEC.kinds)
|
|
assert "username" in body["records"]["users"]["properties"]
|
|
assert "stars" not in body["records"]["posts"]["properties"]
|