Skip to content

Commit

Permalink
fixed failing unit tests as a result of modifying the test ontologies
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorf committed Nov 21, 2024
1 parent 6e2e4f0 commit 9f9b8f1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GIT

GIT
remote: https://github.com/ncbo/ontologies_linked_data.git
revision: cbada0066156727195b350ca365de480e5fdde7a
revision: 0598b9f6e8a37a42938f1db8648ff1b3355be519
branch: multilingual_preflabels
specs:
ontologies_linked_data (0.0.1)
Expand Down
67 changes: 34 additions & 33 deletions test/controllers/test_classes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,42 +295,43 @@ def test_descendants_for_cls
descendants_data = {}
descendants_data['http://bioontology.org/ontologies/ResearchArea.owl#Area_of_Research'] =[
"http://bioontology.org/ontologies/ResearchArea.owl#Behavioral_Science",
"http://bioontology.org/ontologies/ResearchArea.owl#Bioinformatics",
"http://bioontology.org/ontologies/ResearchArea.owl#Biostatistics",
"http://bioontology.org/ontologies/ResearchArea.owl#Clinical_Studies",
"http://bioontology.org/ontologies/ResearchArea.owl#Computational_Biology",
"http://bioontology.org/ontologies/ResearchArea.owl#Epidemiology",
"http://bioontology.org/ontologies/ResearchArea.owl#Genomics",
"http://bioontology.org/ontologies/ResearchArea.owl#Metabolomics",
"http://bioontology.org/ontologies/ResearchArea.owl#Nursing",
"http://bioontology.org/ontologies/ResearchArea.owl#Outcomes_Research",
"http://bioontology.org/ontologies/ResearchArea.owl#Pathology",
"http://bioontology.org/ontologies/ResearchArea.owl#Pediatrics",
"http://bioontology.org/ontologies/ResearchArea.owl#Pharmacokinetics_Pharmacodynamics",
"http://bioontology.org/ontologies/ResearchArea.owl#Physiology",
"http://bioontology.org/ontologies/ResearchArea.owl#Preclinical",
"http://bioontology.org/ontologies/ResearchArea.owl#Proteomics",
"http://bioontology.org/ontologies/ResearchArea.owl#Psychometrics",
"http://bioontology.org/ontologies/ResearchArea.owl#Research_IT",
"http://bioontology.org/ontologies/ResearchArea.owl#Toxicology"]
"http://bioontology.org/ontologies/ResearchArea.owl#Bioinformatics",
"http://bioontology.org/ontologies/ResearchArea.owl#Biostatistics",
"http://bioontology.org/ontologies/ResearchArea.owl#Clinical_Studies",
"http://bioontology.org/ontologies/ResearchArea.owl#Computational_Biology",
"http://bioontology.org/ontologies/ResearchArea.owl#Epidemiology",
"http://bioontology.org/ontologies/ResearchArea.owl#Genomics",
"http://bioontology.org/ontologies/ResearchArea.owl#Metabolomics",
"http://bioontology.org/ontologies/ResearchArea.owl#Nursing",
"http://bioontology.org/ontologies/ResearchArea.owl#Outcomes_Research",
"http://bioontology.org/ontologies/ResearchArea.owl#Pathology",
"http://bioontology.org/ontologies/ResearchArea.owl#Pediatrics",
"http://bioontology.org/ontologies/ResearchArea.owl#Pharmacokinetics_Pharmacodynamics",
"http://bioontology.org/ontologies/ResearchArea.owl#Physiology",
"http://bioontology.org/ontologies/ResearchArea.owl#Preclinical",
"http://bioontology.org/ontologies/ResearchArea.owl#Proteomics",
"http://bioontology.org/ontologies/ResearchArea.owl#Psychometrics",
"http://bioontology.org/ontologies/ResearchArea.owl#Research_IT",
"http://bioontology.org/ontologies/ResearchArea.owl#Toxicology"]

descendants_data['http://bioontology.org/ontologies/Activity.owl#Activity'] =
["http://bioontology.org/ontologies/Activity.owl#Biospecimen_Management",
"http://bioontology.org/ontologies/Activity.owl#Community_Engagement",
"http://bioontology.org/ontologies/Activity.owl#Gene_Therapy",
"http://bioontology.org/ontologies/Activity.owl#Health_Services",
"http://bioontology.org/ontologies/Activity.owl#IRB",
"http://bioontology.org/ontologies/Activity.owl#Medical_Device_Development",
"http://bioontology.org/ontologies/Activity.owl#Regulatory_Compliance",
"http://bioontology.org/ontologies/Activity.owl#Research_Funding",
"http://bioontology.org/ontologies/Activity.owl#Research_Lab_Management",
"http://bioontology.org/ontologies/Activity.owl#Resource_Inventory",
"http://bioontology.org/ontologies/Activity.owl#Small_Molecule",
"http://bioontology.org/ontologies/Activity.owl#Social_Networking",
"http://bioontology.org/ontologies/Activity.owl#Software_Development",
"http://bioontology.org/ontologies/Activity.owl#Surgical_Procedure",
"http://bioontology.org/ontologies/Activity.owl#Therapeutics",
"http://bioontology.org/ontologies/Activity.owl#Training"]
"http://bioontology.org/ontologies/Activity.owl#Catalog",
"http://bioontology.org/ontologies/Activity.owl#Community_Engagement",
"http://bioontology.org/ontologies/Activity.owl#Gene_Therapy",
"http://bioontology.org/ontologies/Activity.owl#Health_Services",
"http://bioontology.org/ontologies/Activity.owl#IRB",
"http://bioontology.org/ontologies/Activity.owl#Medical_Device_Development",
"http://bioontology.org/ontologies/Activity.owl#Regulatory_Compliance",
"http://bioontology.org/ontologies/Activity.owl#Research_Funding",
"http://bioontology.org/ontologies/Activity.owl#Research_Lab_Management",
"http://bioontology.org/ontologies/Activity.owl#Resource_Inventory",
"http://bioontology.org/ontologies/Activity.owl#Small_Molecule",
"http://bioontology.org/ontologies/Activity.owl#Social_Networking",
"http://bioontology.org/ontologies/Activity.owl#Software_Development",
"http://bioontology.org/ontologies/Activity.owl#Surgical_Procedure",
"http://bioontology.org/ontologies/Activity.owl#Therapeutics",
"http://bioontology.org/ontologies/Activity.owl#Training"]

clss_ids = [ 'http://bioontology.org/ontologies/Activity.owl#Activity',
"http://bioontology.org/ontologies/ResearchArea.owl#Area_of_Research" ]
Expand Down
28 changes: 14 additions & 14 deletions test/controllers/test_metrics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def before_suite
end
OntologySubmission.all.each {|s| s.delete }
Ontology.all.each {|o| o.delete }
@@data = {"classes"=>486,
"averageChildCount"=>5,
"maxChildCount"=>65,
"classesWithOneChild"=>14,
"classesWithMoreThan25Children"=>2,
"classesWithNoDefinition"=>11,
"individuals"=>124,
"properties"=>63,
"maxDepth"=> 7 }
@@data = {"classes" => 487,
"averageChildCount" => 5,
"maxChildCount" => 65,
"classesWithOneChild" => 14,
"classesWithMoreThan25Children" => 2,
"classesWithNoDefinition" => 11,
"individuals" => 124,
"properties" => 63,
"maxDepth" => 7 }
@@options = { ont_count: 2,
submission_count: 3,
submissions_to_process: [1, 2],
Expand All @@ -35,8 +35,8 @@ def test_all_metrics
#TODO: improve this test and test for two different ontologies
#though this is tested in LD
metrics.each do |m|
@@data.each do |k,v|
assert_equal(m[k], v)
@@data.each do |k, v|
assert_equal(v, m[k])
end
assert m["@id"] == m["submission"].first + "/metrics"
end
Expand All @@ -49,7 +49,7 @@ def test_single_metrics
metrics = MultiJson.load(last_response.body)

@@data.each do |k,v|
assert_equal(metrics[k], v)
assert_equal(v, metrics[k])
end
end

Expand All @@ -59,7 +59,7 @@ def test_metrics_with_submission_id
assert last_response.ok?
metrics = MultiJson.load(last_response.body)
@@data.each do |k,v|
assert_equal(metrics[k], v)
assert_equal(v, metrics[k])
end
end

Expand All @@ -69,7 +69,7 @@ def test_metrics_with_submission_id_as_param
assert last_response.ok?
metrics = MultiJson.load(last_response.body)
@@data.each do |k,v|
assert_equal(metrics[k], v)
assert_equal(v, metrics[k])
end
end

Expand Down

0 comments on commit 9f9b8f1

Please sign in to comment.