GET request for multiple score sets#683
Conversation
bencap
left a comment
There was a problem hiding this comment.
Thanks @jstone-dev, looks good. Although I know it's covered by existing tests for fetch_score_set_by_urn, I think guaranteeing permission checks are working at the level of each endpoint is important enough to warrant the duplication. Could you please be able to add a few auth tests?
- anonymous users can fetch public score sets
- anonymous users cannot fetch private score sets
- authenticated users can fetch private score sets
- mixed private/public requests fail w/ 404
Just don't want us to refactor the endpoint away from the auth safety of fetch_score_set_by_urn at some point and not have the tests in place to catch it.
|
Thanks; I added five new API-level authorization unit tests. |
bencap
left a comment
There was a problem hiding this comment.
Looks great, save one test that was probably copy/pasted. We can merge this in once we either remove it or alter the logic to test the contributor logic of this endpoint.
| assert f"score set with URN '{private_score_set['urn']}' not found" in response.json()["detail"] | ||
|
|
||
|
|
||
| def test_can_add_contributor_in_both_experiment_and_score_set(session, client, setup_router_db): |
There was a problem hiding this comment.
This one looks like it wasn't updated from the original test it was pulled from.
There was a problem hiding this comment.
This is actually a previously-existing test; I reordered the tests a little because the existing "get score set" tests were interrupted by these contributor tests, and I wanted to group them together in order to have a good place for the new tests. I think moving the contributor tests made the diff look more confusing than it actually is.
There was a problem hiding this comment.
Oh ok, sorry I didn't realize! Looks good in that case.
This pull request introduces a new API endpoint for fetching multiple score sets by a comma-separated list of URNs, along with comprehensive tests to verify its behavior. The changes enhance the flexibility of the score set retrieval functionality and improve validation and error handling.
New API endpoint for batch score set retrieval:
show_score_setsendpoint toscore_sets.pythat allows fetching multiple score sets via a comma-separatedurnsquery parameter. The endpoint validates input, enriches experiment data, and returns a list of score sets.Testing enhancements for new functionality: