Skip to content

Commit

Permalink
changed expected test cases to from IRI to URI references
Browse files Browse the repository at this point in the history
changed server endpoints to new names in testcases
  • Loading branch information
ReggaeUlli committed Dec 21, 2023
1 parent 2252103 commit 818acaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ def test_get_onto_subclasses(client):
# check if correct subclasses are returned
response_obj = json.loads(response.text)

wanted_response = [{"name":"Combining","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Combining","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Combining"}]}],"children":[{"name":"Absorbing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Absorbing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Absorbing"}]}],"children":[]},{"name":"Adsorbing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Adsorbing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Adsorbing"}]}],"children":[]},{"name":"Atomizing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Atomizing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Atomizing"}]}],"children":[]},{"name":"Dissolving","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Dissolving","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Dissolving"}]}],"children":[]},{"name":"Emulsifying","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Emulsifying","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Emulsifying"}]}],"children":[]},{"name":"Foam_creating","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Foam_creating","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Foam_creating"}]}],"children":[]},{"name":"Fusing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Fusing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Fusing"}]}],"children":[]},{"name":"Kneading","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Kneading","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Kneading"}]}],"children":[]},{"name":"Mixing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Mixing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Mixing"}]}],"children":[]},{"name":"Mixing_of_Gases","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Mixing_of_Gases","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Mixing_of_Gases"}]}],"children":[]},{"name":"Mixing_of_Liquids","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Mixing_of_Liquids","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Mixing_of_Liquids"}]}],"children":[]},{"name":"Moistening_of_Gases","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Moistening_of_Gases","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Moistening_of_Gases"}]}],"children":[]},{"name":"Rubbing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Rubbing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Rubbing"}]}],"children":[]},{"name":"Smoothing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Smoothing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Smoothing"}]}],"children":[]},{"name":"Soaking","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Soaking","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Soaking"}]}],"children":[]},{"name":"Spraying","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Spraying","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Spraying"}]}],"children":[]},{"name":"Suspending","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Suspending","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Suspending"}]}],"children":[]},{"name":"Swelling","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Swelling","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Swelling"}]}],"children":[]},{"name":"Volatilizing","otherInformation":[{"otherInfoID":"OntologyIRI","description":["Iri referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Volatilizing","dataType":"Text","unitOfMeasure":"url","key":"Capability_with_Query.Volatilizing"}]}],"children":[]}]}]
wanted_response = [{"name":"Combining","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Combining","dataType":"uriReference","key":"Capability_with_Query.Combining"}]}],"children":[{"name":"Absorbing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Absorbing","dataType":"uriReference","key":"Capability_with_Query.Absorbing"}]}],"children":[]},{"name":"Adsorbing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Adsorbing","dataType":"uriReference","key":"Capability_with_Query.Adsorbing"}]}],"children":[]},{"name":"Atomizing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Atomizing","dataType":"uriReference","key":"Capability_with_Query.Atomizing"}]}],"children":[]},{"name":"Dissolving","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Dissolving","dataType":"uriReference","key":"Capability_with_Query.Dissolving"}]}],"children":[]},{"name":"Emulsifying","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Emulsifying","dataType":"uriReference","key":"Capability_with_Query.Emulsifying"}]}],"children":[]},{"name":"Foam_creating","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Foam_creating","dataType":"uriReference","key":"Capability_with_Query.Foam_creating"}]}],"children":[]},{"name":"Fusing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Fusing","dataType":"uriReference","key":"Capability_with_Query.Fusing"}]}],"children":[]},{"name":"Kneading","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Kneading","dataType":"uriReference","key":"Capability_with_Query.Kneading"}]}],"children":[]},{"name":"Mixing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Mixing","dataType":"uriReference","key":"Capability_with_Query.Mixing"}]}],"children":[]},{"name":"Mixing_of_Gases","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Mixing_of_Gases","dataType":"uriReference","key":"Capability_with_Query.Mixing_of_Gases"}]}],"children":[]},{"name":"Mixing_of_Liquids","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Mixing_of_Liquids","dataType":"uriReference","key":"Capability_with_Query.Mixing_of_Liquids"}]}],"children":[]},{"name":"Moistening_of_Gases","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Moistening_of_Gases","dataType":"uriReference","key":"Capability_with_Query.Moistening_of_Gases"}]}],"children":[]},{"name":"Rubbing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Rubbing","dataType":"uriReference","key":"Capability_with_Query.Rubbing"}]}],"children":[]},{"name":"Smoothing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Smoothing","dataType":"uriReference","key":"Capability_with_Query.Smoothing"}]}],"children":[]},{"name":"Soaking","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Soaking","dataType":"uriReference","key":"Capability_with_Query.Soaking"}]}],"children":[]},{"name":"Spraying","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Spraying","dataType":"uriReference","key":"Capability_with_Query.Spraying"}]}],"children":[]},{"name":"Suspending","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Suspending","dataType":"uriReference","key":"Capability_with_Query.Suspending"}]}],"children":[]},{"name":"Swelling","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Swelling","dataType":"uriReference","key":"Capability_with_Query.Swelling"}]}],"children":[]},{"name":"Volatilizing","otherInformation":[{"otherInfoID":"SemanticDescription","description":["URI referencing the Ontology Class definition"],"otherValue":[{"valueString":"http://www.acplt.de/Capability#Volatilizing","dataType":"uriReference","key":"Capability_with_Query.Volatilizing"}]}],"children":[]}]}]
assert response_obj == wanted_response

def test_validate(client):
#only the first level opining and closing element
response = client.get('/validate', query_string={'xml_string': '<p0:GRecipe xmlns:p0="http://www.mesa.org/xml/B2MML"></p0:GRecipe>'})
response = client.get('/grecipe/validate', query_string={'xml_string': '<p0:GRecipe xmlns:p0="http://www.mesa.org/xml/B2MML"></p0:GRecipe>'})
assert response.status_code == 200

#the generated string when hitting export
response = client.get('/validate', query_string={'xml_string': '<p0:GRecipe xmlns:p0="http://www.mesa.org/xml/B2MML"><p0:ID/><p0:Description/><p0:GRecipeType>General</p0:GRecipeType><p0:Formula><p0:ProcessInputs><p0:ID>inputid</p0:ID><p0:MaterialsType>Input</p0:MaterialsType></p0:ProcessInputs><p0:ProcessOutputs><p0:ID>outputsid</p0:ID><p0:MaterialsType>Output</p0:MaterialsType></p0:ProcessOutputs><p0:ProcessIntermediates><p0:ID>intermediateid</p0:ID><p0:MaterialsType>Intermediate</p0:MaterialsType></p0:ProcessIntermediates></p0:Formula><p0:ProcessProcedure><p0:ID>Procedure1</p0:ID><p0:ProcessElementType>Process</p0:ProcessElementType></p0:ProcessProcedure><p0:ResourceConstraint/><p0:OtherInformation/></p0:GRecipe>'})
response = client.get('/grecipe/validate', query_string={'xml_string': '<p0:GRecipe xmlns:p0="http://www.mesa.org/xml/B2MML"><p0:ID/><p0:Description/><p0:GRecipeType>General</p0:GRecipeType><p0:Formula><p0:ProcessInputs><p0:ID>inputid</p0:ID><p0:MaterialsType>Input</p0:MaterialsType></p0:ProcessInputs><p0:ProcessOutputs><p0:ID>outputsid</p0:ID><p0:MaterialsType>Output</p0:MaterialsType></p0:ProcessOutputs><p0:ProcessIntermediates><p0:ID>intermediateid</p0:ID><p0:MaterialsType>Intermediate</p0:MaterialsType></p0:ProcessIntermediates></p0:Formula><p0:ProcessProcedure><p0:ID>Procedure1</p0:ID><p0:ProcessElementType>Process</p0:ProcessElementType></p0:ProcessProcedure><p0:ResourceConstraint/><p0:OtherInformation/></p0:GRecipe>'})
assert response.status_code == 200

# Add more test assertions as needed
Expand Down

0 comments on commit 818acaa

Please sign in to comment.