dandi / dandi-cli

DANDI command line client to facilitate common operations
https://dandi.readthedocs.io/
Apache License 2.0
22 stars 28 forks source link

Add arguments for API query parameters when fetching all Dandisets; support creating embargoed Dandisets #1414

Closed jwodder closed 9 months ago

jwodder commented 9 months ago

Closes #1413.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.61%. Comparing base (5970a3b) to head (1ed5a55). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1414 +/- ## ========================================== + Coverage 88.58% 88.61% +0.02% ========================================== Files 77 77 Lines 10499 10527 +28 ========================================== + Hits 9301 9328 +27 - Misses 1198 1199 +1 ``` | [Flag](https://app.codecov.io/gh/dandi/dandi-cli/pull/1414/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dandi) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/dandi/dandi-cli/pull/1414/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dandi) | `88.61% <100.00%> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dandi#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jwodder commented 9 months ago

@yarikoptic

test listing here for a set of query parameters to see that they map correctly to the API call

What exactly should be tested? Should there just be a test for each bool argument that checks that a matching Dandiset is/isn't returned when the argument is true/false?

Note that there can't be a test that checks the entirety of the get_dandisets() return value, as the test Dandisets created for most tests persist in later tests, and it's possible for tests to be skipped or run out of order, so there's no guarantee about what Dandisets will exist in the test Archive when a test runs.

yarikoptic commented 9 months ago

Note that there can't be a test that checks the entirety of the get_dandisets() return value, as the test Dandisets created for most tests persist in later tests, and it's possible for tests to be skipped or run out of order, so there's no guarantee about what Dandisets will exist in the test Archive when a test runs.

I didn't realize that -- I thought that we just have a fixture to populate a number of dandisets and then test on them.

What exactly should be tested? Should there just be a test for each bool argument that checks that a matching Dandiset is/isn't returned when the argument is true/false?

I think testing for that would suffice. Fixture could ensure to populate at least one dandiset to satisfy each criteria, then (with the light of above) - we could test that there is at least one dandiset satisfying the desired criteria.

yarikoptic commented 9 months ago

Thank you!

github-actions[bot] commented 8 months ago

:rocket: PR was released in 0.61.0 :rocket: