Summary
Build a comprehensive test suite for the Python reconciler that covers all endpoints and specifically handles ROR API v2 merge/redirect behavior. The current Ruby implementation has limited test coverage. The Python port should include tests that validate reconciliation logic against realistic ROR API responses.
Tests
GET /heartbeat
- Returns 200 with JSON containing status, version, PID, Python version
- Validates response schema
GET /reconcile (service metadata)
- Returns correct W3C Reconciliation API service manifest
- Includes service name, identifierSpace, schemaSpace, default types, preview and suggest metadata
POST /reconcile (reconciliation queries)
- Single query returns up to 5 scored results with ROR IDs, names, and types
- Batch queries (multiple
q0, q1, ... keys) return independent result sets
- Empty/whitespace query returns empty results
- Special characters in query names (; & / ?) are handled correctly
- Query matching an exact organization name returns that org with a high score and
match: true
- Query with no matches returns an empty result list
GET /suggest
- Returns suggestions matching a prefix
- Empty prefix returns empty results
- Results include id, name, and description fields
GET /flyout
- Returns HTML snippet and ROR ID for a valid organization
- Invalid ROR ID returns appropriate error/empty response
GET /preview/*
- Returns rendered HTML preview for a valid ROR ID
- Handles both bare ROR IDs and full
https://ror.org/... URLs
- Invalid ROR ID returns appropriate error
GET /
Integration tests
- End-to-end test with a running app instance that runs through the full request lifecycle from HTTP request through ROR API call (mocked) to response rendering
- Verify CORS headers are present on responses
Acceptance criteria
Summary
Build a comprehensive test suite for the Python reconciler that covers all endpoints and specifically handles ROR API v2 merge/redirect behavior. The current Ruby implementation has limited test coverage. The Python port should include tests that validate reconciliation logic against realistic ROR API responses.
Tests
GET /heartbeatGET /reconcile(service metadata)POST /reconcile(reconciliation queries)q0,q1, ... keys) return independent result setsmatch: trueGET /suggestGET /flyoutGET /preview/*https://ror.org/...URLsGET /Integration tests
Acceptance criteria