File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,3 +331,17 @@ def test_issue0069(om):
331331 results = om .core .License .by_name ("Creative Commons" , all = True , match = "contains" )
332332 assert len (results ) == 7
333333 assert all ("CC" in r .short_name for r in results )
334+
335+ @pytest .mark .parametrize ("om" , [openminds .latest ])
336+ def test_pr0083 (om ):
337+ # https://github.com/openMetadataInitiative/openMINDS_Python/pull/83
338+ # by_name() should return None consistently
339+ # when no matches are found, regardless of the 'all' parameter
340+
341+ # all=False (default) should return None when no match is found
342+ result = om .controlled_terms .BiologicalOrder .by_name ("nonexistent_order_xyz" )
343+ assert result is None
344+
345+ # all=True should also return None when no match is found
346+ results = om .controlled_terms .BiologicalOrder .by_name ("nonexistent_order_xyz" , all = True )
347+ assert results is None
You can’t perform that action at this time.
0 commit comments