cpinter
(Csaba Pinter)
1
I’m writing a few new automated python tests for extensions, and realized that I keep adding the same functions in my tests unchanged. These functions
- Download data, unzip to temp folder, verify total number of unzipped files
- Import data to temporary DICOM database from the above folder
- Select loadables, verify plugin selection, and load loadables
Do you think it would make sense to add these in the ScriptedLoadableModuleTest class?
2 Likes
jcfr
(Jean Christophe Fillion Robin (Kitware))
2
It could be added to the slicer.testing
module.
Ideally, it could be used as a function or a context manager.
something like:
with TemporaryDICOMData(url="http://path/to/file.zip") as loader:
assert loader.selected_plugins == ["plugin1", ...]
[...]
2 Likes
cpinter
(Csaba Pinter)
3
Thanks! I’ll try to do it like this then. I’ll be back with a PR.
1 Like
cpinter
(Csaba Pinter)
4
I think I’ll add this to https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOMLib/DICOMUtils.py instead. There is a feature very similar to the proposed one here already, and it would be confusing to separate them.
2 Likes
cpinter
(Csaba Pinter)
5
I issued the pull request: https://github.com/Slicer/Slicer/pull/835
I tested it with SubjectHierarchyGenericSelfTest and GelDosimetryAnalysis, both work well.
1 Like