Skip to content
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

Add tests for getObjectsByMapAnnotations #6273

Merged
merged 3 commits into from
Aug 25, 2021

Conversation

dominikl
Copy link
Member

@dominikl dominikl commented Apr 8, 2021

Add integration test for ome/omero-py#285 .

@will-moore
Copy link
Member

Thanks @dominikl - That looks like pretty good coverage.
Tests all passing at https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/732/testReport/OmeroPy.test.integration.gatewaytest.test_get_objects/TestGetObject/

I guess one thing that could be added is to confirm that without a leading (or trailing) wild-card returns nothing.

# returns nothing
wc = value[2:12]+"*"
# returns something
wc = value[0:12]+"*"

And could also test that the limit works:

# should only return 2 objects (and don't need key, value or ns)
conn.getObjectsByMapAnnotations(datatype, opts={"limit": 2})

Actually, I just tried that myself and found a bug!
Since I'm initially querying for ImageAnnotationLinks I was getting duplicate Images in that list, but then the returned objects list were removing the duplicates. So for the opts={"limit": 2} - that meant that only 2 ImageAnnotationLinks were found, but if they were both for the same Image, then I'd only get 1 Image returned!
I only found that issue because in my local server I have many Images with multiple MapAnnotations.

That is now fixed by ome/omero-py@d27f2f0

So maybe if your createTarget() actually added 2 identical Map annotations to each object, then test if conn.getObjectsByMapAnnotations(datatype, opts={"limit": 4}) actually gets 4 objects.

Thanks!

@dominikl
Copy link
Member Author

dominikl commented Apr 9, 2021

👍 I'll add the additional tests.

Copy link
Member

@will-moore will-moore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Passing locally (but fails if I don't have last commit ome/omero-py@d27f2f0) 👍

@joshmoore joshmoore merged commit 22a81b6 into ome:develop Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants