-
Notifications
You must be signed in to change notification settings - Fork 512
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
Fix py_SubjectHierarchyGenericSelfTest test #7288
Comments
It seems that the failure is due to the fact that the showEmptyHierarchyItems flag is on in the proxy model. Trying to see why it is enabled. |
Updating the expected value makes sense and would be consistent with the new default behavior.
I also suggest to update to check that setting After loading SubjectHierarchyAttributeFilterTestScene.mrb, I used the following convenient snippet based of the current test: shTreeView = slicer.qMRMLSubjectHierarchyTreeView()
shTreeView.setMRMLScene(slicer.mrmlScene)
shTreeView.show()
shProxyModel = shTreeView.sortFilterProxyModel()
shNode = slicer.mrmlScene.GetSubjectHierarchyNode()
assert shProxyModel.acceptedItemCount(shNode.GetSceneItemID()) == 9
shProxyModel.includeNodeAttributeNamesFilter = ['Markups.MovingInSliceView']
# By default, shProxyModel.showEmptyHierarchyItems is True
assert shProxyModel.acceptedItemCount(shNode.GetSceneItemID()) == 6
shProxyModel.showEmptyHierarchyItems = False
assert shProxyModel.acceptedItemCount(shNode.GetSceneItemID()) == 5 |
- The test assumed incorrect shown item count including the empty folder (which flag is enabled by default), expected item counts has been fixed - Add test for the showEmptyHierarchyItems flag, which has not been tested until now Re Slicer#7288
PR ready to review. Yes I also realized the |
Follow-up of 5f7ae8d (ENH: Improve empty folder visibility logic): - The test assumed incorrect shown item count including the empty folder (which flag is enabled by default), expected item counts has been fixed - Update testAttributeFilters to check for showEmptyHierarchyItems flag, which has not been tested until now Re Slicer#7288 Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Follow-up of 5f7ae8d (ENH: Improve empty folder visibility logic): - Update test to consider that empty folders are now visible by default. - Update testAttributeFilters to check for showEmptyHierarchyItems set to False and True. Fixes Slicer#7288 Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Follow-up of 5f7ae8d (ENH: Improve empty folder visibility logic): - Update test to consider that empty folders are now visible by default. - Update testAttributeFilters to check for showEmptyHierarchyItems set to False and True. Fixes #7288 Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Summary
The test
py_SubjectHierarchyGenericSelfTest
passed on all platform when executed against a build of Slicer 31ba894 and started to fail with Slicer 80ad0a0.Useful links
Compare link: 31ba894...80ad0a0
Associated pull requests:
Test sources: https://github.com/Slicer/Slicer/blob/main/Modules/Loadable/SubjectHierarchy/Testing/Python/SubjectHierarchyGenericSelfTest.py
Steps to reproduce
Expected behavior
Test should pass on all platform
The text was updated successfully, but these errors were encountered: