File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def metadata(self):
5050 def subcollections (self ):
5151 query = self .manager .sess .query (Collection )\
5252 .filter (Collection .parent_name == self .path )
53- return [iRODSCollection (self .manager , row ) for row in query ]
53+ return [iRODSCollection (self .manager , row ) for row in query if row [ Collection . name ] != '/' ]
5454
5555 @property
5656 def data_objects (self ):
Original file line number Diff line number Diff line change @@ -489,6 +489,15 @@ def test_touch_operation_ignores_unsupported_options__525(self):
489489 if collection :
490490 user_session .collections .remove (path , recurse = True , force = True )
491491
492+ def test_subcollections_member_excludes_root_collection__571 (self ):
493+
494+ root_coll = self .sess .collections .get ("/" )
495+
496+ # Assert that none of the root collection's immediate children (as listed in the object's
497+ # 'subcollections' property) point to the root subcollection.
498+ self .assertEqual (root_coll .path , "/" )
499+ self .assertEqual ([], [_ for _ in root_coll .subcollections if _ .path == "/" ])
500+
492501
493502if __name__ == "__main__" :
494503 # let the tests find the parent irods lib
You can’t perform that action at this time.
0 commit comments