@@ -139,26 +139,55 @@ def test_get_ontologies(self):
139139 self .assertIsInstance (ontology_sources , list )
140140 self .assertIsInstance (ontology_sources [0 ], OntologySource )
141141
142- @unittest .skip ("efo is not available from https://www.ebi.ac.uk/ols4/api/ontologies" )
143- def test_get_ontology (self ):
144- ontology_source = ols .get_ols_ontology ("efo" )
142+ # @unittest.skip("efo is not available from https://www.ebi.ac.uk/ols4/api/ontologies")
143+ def test_get_ontology0 (self ):
144+ ontology_source = ols .get_ols_ontology ("ado" , 0 )
145+ self .assertIsInstance (ontology_source , OntologySource )
146+ self .assertEqual (ontology_source .name , "ado" )
147+ self .assertIn ("://www.ebi.ac.uk/ols" , ontology_source .file )
148+ self .assertIn ("/api/ontologies/ado?lang=en" , ontology_source .file )
149+ self .assertIsInstance (ontology_source .version , str )
150+ self .assertEqual (ontology_source .description , "Alzheimer's Disease Ontology (ADO)" )
151+
152+ def test_get_ontology1 (self ):
153+ ontology_source = ols .get_ols_ontology ("stato" , 1 )
154+ self .assertIsInstance (ontology_source , OntologySource )
155+ self .assertEqual (ontology_source .name , "stato" )
156+ self .assertIn ("://www.ebi.ac.uk/ols" , ontology_source .file )
157+ self .assertIn ("/api/ontologies/stato?lang=en" , ontology_source .file )
158+ self .assertIsInstance (ontology_source .version , str )
159+ self .assertEqual (ontology_source .description , "STATO: the statistical methods ontology" )
160+
161+ def test_get_ontology2 (self ):
162+ ontology_source = ols .get_ols_ontology ("efo" , 2 )
145163 self .assertIsInstance (ontology_source , OntologySource )
146164 self .assertEqual (ontology_source .name , "efo" )
147165 self .assertIn ("://www.ebi.ac.uk/ols" , ontology_source .file )
148166 self .assertIn ("/api/ontologies/efo?lang=en" , ontology_source .file )
149167 self .assertIsInstance (ontology_source .version , str )
150168 self .assertEqual (ontology_source .description , "Experimental Factor Ontology" )
151169
152- @unittest .skip ("efo is not available from https://www.ebi.ac.uk/ols4/api/ontologies" )
153- def test_search_for_term (self ):
154- ontology_source = ols .get_ols_ontology ("efo" )
155- ontology_annotations = ols .search_ols ("cell type" , ontology_source )
170+ # @unittest.skip("efo is not available from https://www.ebi.ac.uk/ols4/api/ontologies")
171+ def test_search_for_term_p0 (self ):
172+ ontology_source = ols .get_ols_ontology ("chmo" , 0 )
173+ ontology_annotations = ols .search_ols ("mobile phase" , ontology_source )
174+ self .assertIsInstance (ontology_annotations , list )
175+ self .assertGreater (len (ontology_annotations ), 0 )
176+ ontology_annotations = [oa for oa in ontology_annotations if oa .term == "mobile phase" ]
177+ self .assertIsInstance (ontology_annotations [- 1 ], OntologyAnnotation )
178+ self .assertEqual (ontology_annotations [- 1 ].term , "mobile phase" )
179+ self .assertIn ("http://purl.obolibrary.org/obo/CHMO_0000995" , [oa .term_accession for oa in ontology_annotations ])
180+ self .assertEqual (ontology_annotations [- 1 ].term_source , ontology_source )
181+
182+ def test_search_for_term_p1 (self ):
183+ ontology_source = ols .get_ols_ontology ("efo" , 2 )
184+ ontology_annotations = ols .search_ols ("time" , ontology_source )
156185 self .assertIsInstance (ontology_annotations , list )
157186 self .assertGreater (len (ontology_annotations ), 0 )
158- ontology_annotations = [oa for oa in ontology_annotations if oa .term == "cell type " ]
187+ ontology_annotations = [oa for oa in ontology_annotations if oa .term == "time " ]
159188 self .assertIsInstance (ontology_annotations [- 1 ], OntologyAnnotation )
160- self .assertEqual (ontology_annotations [- 1 ].term , "cell type " )
161- self .assertIn ("http://www.ebi.ac.uk/efo/EFO_0000324 " , [oa .term_accession for oa in ontology_annotations ])
189+ self .assertEqual (ontology_annotations [- 1 ].term , "time " )
190+ self .assertIn ("http://www.ebi.ac.uk/efo/EFO_0000721 " , [oa .term_accession for oa in ontology_annotations ])
162191 self .assertEqual (ontology_annotations [- 1 ].term_source , ontology_source )
163192
164193
0 commit comments