Skip to content

Commit

Permalink
Update tests and ontology imports
Browse files Browse the repository at this point in the history
- Fix tests counting number of images (must be 12)
- Fix ROI mapping so regionOfInterest property points to ROI as a property of Image.
- Load patched ome_core ontology with removed domain annotations from ome_core:image
  • Loading branch information
Carsten Fortmann-Grote committed Dec 16, 2024
1 parent a8243e8 commit c0d180f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def test_dataset_type_relations(self):
"""
response = graph.query(query_string)

print([r for r in response])
self.assertEqual(len(response), 1)
self.assertEqual(int([r.n_types for r in response][0]), 1)

Expand Down Expand Up @@ -154,9 +155,9 @@ def test_number_of_projects_datasets_images(self):

# Check numbers.
number_of_objects = [r for r in response][0]
self.assertEqual(int(number_of_objects.n_projects), 1)
self.assertEqual(int(number_of_objects.n_images ), 12)
self.assertEqual(int(number_of_objects.n_datasets), 3)
self.assertEqual(int(number_of_objects.n_images ), 10)
self.assertEqual(int(number_of_objects.n_projects), 1)

def test_project(self):
""" Test number of projects in the VKG. """
Expand Down Expand Up @@ -222,7 +223,7 @@ def test_image(self):
response = graph.query(query_string)

# Test.
self.assertEqual(len(response), 10)
self.assertEqual(len(response), 12)

def test_project_dataset_image(self):
""" Test a query for a project-dataset-image hierarchy. """
Expand All @@ -248,7 +249,7 @@ def test_project_dataset_image(self):
response = graph.query(query_string)

# Should get 10 images.
self.assertEqual(len(response), 10)
self.assertEqual(len(response), 12)

def test_image_key_value(self):
""" Test querying for an image property via the mapannotation key."""
Expand All @@ -271,7 +272,7 @@ def test_image_key_value(self):
# Run the query.
response = graph.query(query_string)

self.assertEqual(len(response), 10)
self.assertEqual(len(response), 12)

def test_project_key_value(self):
""" Test querying for a project property via the mapannotation key."""
Expand Down Expand Up @@ -359,7 +360,7 @@ def test_tagged_images(self):
bindings = response['results']['bindings']

# All images (10) are tagged.
self.assertEqual(len(bindings), 10)
self.assertEqual(len(bindings), 12)

# They're all tagged "Screenshot"
self.assertEqual(len(set([b['tag']['value'] for b in bindings])), 1)
Expand Down

0 comments on commit c0d180f

Please sign in to comment.