python/scripts/run_dicom_archive_validation.py (implement automated tests) #1240
Closed
8 tasks done
Labels
27.0-testing
Area: CI
PR or issue related to continuous integration, including automated tests and static checks
Write automatic tests for:
run_dicom_archive_validation.py -p database_config.py -t <TARCHIVE PATH>
=> should return
[ERROR ] argument --upload_id is required
and the script help details=> should return ERROR CODE 3 (MISSING_ARG)
run_dicom_archive_validation.py -p database_config.py -u <UPLOADID>
=> should return
[ERROR ] argument --tarchive_path is required
and the script help details=> should return ERROR CODE 3 (MISSING_ARG)
un_dicom_archive_validation.py -z
=> should return
[ERROR ] -z is not a valid option for the script
=> should return ERROR CODE 6 (INVALID_ARG)
run_dicom_archive_validation.py -p database_config.py -t <INVALID PATH> -u <VALID UPLOADID>
=> should return
[ERROR ] <INVALID PATH> does not exist. Please provide a valid path for --tarchive_path
=> should return ERROR CODE 5 (INVALID_PATH)
run_dicom_archive_validation.py -p database_config.py -u <UPLOADID> -t <TARCHIVE PATH>
using inexistant upload ID and random tarchive path=> should return
[ERROR ] Did not find an entry in mri_upload associated with 'UploadID' 16666
=> should return ERROR CODE 23 (SELECT_FAILURE)
run_dicom_archive_validation.py -p database_config.py -u <UPLOADID> -t <TARCHIVE PATH>
using valid upload ID and a valid tarchive path but wrong combination of upload ID and tarchive path (a.k.a. tarchive path not corresponding to the tarchive linked to the upload ID)=> should return
[ERROR ] UploadID <UPLOAD ID> and ArchiveLocation <TARCHIVE PATH> do not refer to the same upload
=> should return ERROR CODE 23 (SELECT_FAILURE)
run_dicom_archive_validation.py -p database_config.py -u <UPLOADID> -t <TARCHIVE PATH>
using valid upload ID, tarchive path and valid combination of upload ID and tarchive path=> run smoothly and update fields
IsTarchiveValidated
andIsCandidateInfoValidated
to 1 in themri_upload
table for the Upload ID that has been run.=> should return ERROR CODE 0 (SUCCESS)
Manual checks:
run_dicom_archive_validation.py -h
=> should print the help of the script. Make sure the help documentation is up to date.
Issues found
The text was updated successfully, but these errors were encountered: