Skip to content

Automated tests for run_nifti_insertion.py #1257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Apr 11, 2025

Conversation

cmadjar
Copy link
Collaborator

@cmadjar cmadjar commented Apr 2, 2025

Description

Tests implemented:

  • test invalid argument
  • test missing NIfTI path argument
  • test invalid NIfTI path
  • test missing upload ID or tarchive path argument
  • test missing JSON path argument
  • test incorrect JSON path
  • test invalid upload ID
  • test invalid tarchive path
  • test upload ID and tarchive path argument (only one should be provided)
  • test insertion of a NIfTI file with a different patient name than the one stored in the DICOMs
  • test insertion of a NIfTI file already uploaded
  • test insertion of a NIfTI file that unknown protocol (insertion in mri_protocol_violated_scans)
  • test insertion of a NIfTI file with a warning violation (insertion in files and mri_violations_log tables)

Left to be implemented in a separate PR:
everything that is not checked yet in #1256

@cmadjar cmadjar added Needs Work Before Merging Blocked Merge it and you die Area: CI PR or issue related to continuous integration, including automated tests and static checks labels Apr 2, 2025
@cmadjar cmadjar added this to the 27.0 milestone Apr 2, 2025
@cmadjar cmadjar self-assigned this Apr 2, 2025
@cmadjar cmadjar removed Needs Work Before Merging Blocked Merge it and you die labels Apr 11, 2025
@cmadjar cmadjar requested a review from maximemulder April 11, 2025 13:19
Copy link
Contributor

@maximemulder maximemulder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR ! I just have a few comments:

  1. The tests look good, but I would use assert to handle None values instead of str-ing things.
  2. Some type errors in the model relationships.
  3. Some naming preferences I have in the models.

So lots of small nits, but still, nice job overall ! Some stuff that I only have a weak opinion on is marked "Optional" if you prefer to ignore it.

@cmadjar cmadjar requested a review from maximemulder April 11, 2025 17:11
Copy link
Contributor

@maximemulder maximemulder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hhhhhhmmmm, I guess considering you have some previous tests assert file.path == f'blablabla' (that I missed whoopsie), you can indeed put the str() back and merge, thanks for the quick reaction !

@cmadjar cmadjar merged commit ce0e775 into aces:main Apr 11, 2025
9 checks passed
@cmadjar cmadjar added Area: BIDS PR or issue related to the handling of BIDS datasets Area: ORM PR or issue related to the SQLAlchemy integration and removed Area: BIDS PR or issue related to the handling of BIDS datasets labels Apr 11, 2025
@cmadjar cmadjar added this to the 27.0 milestone Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: CI PR or issue related to continuous integration, including automated tests and static checks Area: ORM PR or issue related to the SQLAlchemy integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants