diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-10-03 13:49:36 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-10-03 13:49:36 +0000 |
| commit | 7c1bdb98a569d8b6389b222af746155c53aa3761 (patch) | |
| tree | dae203b9214ab0c8d9e1e7a061387d7ddef79e82 /test/python/server_test_case.py | |
| parent | 50385262fa8c26a1c7f5b170b0ccb1196ba2f676 (diff) | |
| download | genenetwork4-7c1bdb98a569d8b6389b222af746155c53aa3761.tar.gz | |
Add /groups and /groups/{group} endpoints.
* src/db.rs (Group): New struct. Summary of one InbredSet row,
matching the shape of GeneNetwork2's GET /api/v_pre1/groups response.
(get_all_groups): New function. Mirrors GeneNetwork2's
wqflask.api.router.get_groups_list (no species filter yet).
(GroupDetail): New struct, deriving FromRow instead of being built
from a tuple like SpeciesDetail, since InbredSet has 14 columns, more
than mysql_common's FromRow is implemented for tuples (up to 12).
FromRow matches by column name (PascalCase of the field name via
#[mysql(rename_all = "PascalCase")]), except public, which is
lowercase in the schema and needs its own #[mysql(rename = "public")].
(get_group_by_name): New function. Mirrors GeneNetwork2's
wqflask.api.router.get_group_info, but returns every column instead of
a fixed subset.
* src/lib.rs (app): Add /groups and /groups/{group} routes.
(groups, group_by_name): New handlers, following the same
ApiError/request-id/spawn_blocking pattern as species/species_by_name.
(group_by_name): On no match, set ApiError's next to /groups.
* tests/groups.rs: New file. Checks BXD is present (used throughout
the GeneNetwork2 and GeneNetwork3 test suites as a fixture group,
always present in the database); skips rather than fails when no
database is reachable, same as species.rs.
* test/python/test_groups.py: New file. Likewise.
* tests/group_by_name.rs: New file. Checks BXD's full row and an
unknown-group 404 case, same pattern as species_by_name.rs.
* test/python/test_group_by_name.py: New file. Likewise.
* tests/openapi.rs (openapi_json_describes_all_endpoints): Check for
/groups and /groups/{group} among the documented paths.
* test/python/test_openapi.py
(test_openapi_json_describes_all_endpoints): Likewise.
* README.md: Document /groups and /groups/{group}.
Diffstat (limited to 'test/python/server_test_case.py')
0 files changed, 0 insertions, 0 deletions
