Skip to content

Commit

Permalink
test cleanup and repair
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaper committed May 30, 2024
1 parent e8c735e commit 59e04ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
21 changes: 0 additions & 21 deletions tests/test_amigo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@

from linkml.generators.yamlgen import YAMLGenerator
from tests.test_models.amigo import *
from tests.test_models.amigo_api import AmigoSolrAPI
import tests.test_models.amigo as amigo
import linkml_dataops

from tests import INPUT_DIR, MODEL_DIR

from linkml_solr import SolrQueryEngine, SolrEndpoint
from SPARQLWrapper import SPARQLWrapper, N3
from rdflib import Graph

DATA = os.path.join(INPUT_DIR, 'kitchen_sink_inst_01.yaml')
CONTEXT = os.path.join(MODEL_DIR, 'kitchen_sink.context.jsonld')
Expand Down Expand Up @@ -72,23 +68,6 @@ def test_intersection_query(self):
n += 1
assert n == 1

def test_api(self):
schema = YAMLGenerator(SCHEMA).schema
qe = SolrQueryEngine(schema=schema,
discriminator_field=amigo.slots.document_category.name,
python_classes=[OntologyClass],
endpoint=SolrEndpoint(url='http://golr.geneontology.org/solr/'))
qe = self.sqe
api = AmigoSolrAPI(query_engine=qe)
c = api.fetch_OntologyClass(NUCLEAR_MEMBRANE)
print(c)
self.assertEqual('nuclear membrane', c.annotation_class_label)
self.assertEqual(NUCLEAR_MEMBRANE, c.annotation_class)
results = list(api.query_OntologyClass(isa_partof_closure=[NUCLEAR_MEMBRANE, PROTEIN_COMPLEX]))
for r in results:
print(f'{r.id} {r.annotation_class_label}')
assert len(results) > 1


if __name__ == '__main__':
unittest.main()
6 changes: 3 additions & 3 deletions tests/test_solrschemagen.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class SolrSchemaGenTestCase(unittest.TestCase):
def test_gensolrschema(self):
""" generate a flattened schema """
gen = SolrSchemaGenerator(SCHEMA)
s = gen.serialize()
gen.serialize()
s = gen.post_request
#print(s)
doc = json.loads(s)
fields = doc['add-field']
fields = s['add-field']
test_fields = [
{
"name": "alternate_id",
Expand Down

0 comments on commit 59e04ae

Please sign in to comment.