Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Jun 27, 2024
1 parent b244ac7 commit 86fc607
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,58 @@ def test_lt():

term = kg.ontology.terms.cmso.hasNumberOfAtoms
term = term < 2
assert term._condition == '(?cmso:hasNumberOfAtomsvalue<"2"^^xsd:int)'
assert term._condition == '(?hasNumberOfAtomsvalue<"2"^^xsd:int)'

def test_eq():
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg)

term = kg.ontology.terms.cmso.hasNumberOfAtoms
term = (term == 2)
assert term._condition == '(?cmso:hasNumberOfAtomsvalue="2"^^xsd:int)'
assert term._condition == '(?hasNumberOfAtomsvalue="2"^^xsd:int)'

def test_gt():
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg)

term = kg.ontology.terms.cmso.hasNumberOfAtoms
term = term > 2
assert term._condition == '(?cmso:hasNumberOfAtomsvalue>"2"^^xsd:int)'
assert term._condition == '(?hasNumberOfAtomsvalue>"2"^^xsd:int)'

def test_lte():
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg)

term = kg.ontology.terms.cmso.hasNumberOfAtoms
term = term <= 2
assert term._condition == '(?cmso:hasNumberOfAtomsvalue<="2"^^xsd:int)'
assert term._condition == '(?hasNumberOfAtomsvalue<="2"^^xsd:int)'

def test_gte():
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg)

term = kg.ontology.terms.cmso.hasNumberOfAtoms
term = term >= 2
assert term._condition == '(?cmso:hasNumberOfAtomsvalue>="2"^^xsd:int)'
assert term._condition == '(?hasNumberOfAtomsvalue>="2"^^xsd:int)'

def test_ne():
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg)

term = kg.ontology.terms.cmso.hasNumberOfAtoms
term = term != 2
assert term._condition == '(?cmso:hasNumberOfAtomsvalue!="2"^^xsd:int)'
assert term._condition == '(?hasNumberOfAtomsvalue!="2"^^xsd:int)'

def test_and():
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg)

term = (kg.ontology.terms.cmso.hasVolume > 2) & (kg.ontology.terms.cmso.hasVolume < 4)
assert term._condition == '((?cmso:hasVolumevalue>"2"^^xsd:float)&&(?cmso:hasVolumevalue<"4"^^xsd:float))'
assert term._condition == '((?hasVolumevalue>"2"^^xsd:float)&&(?hasVolumevalue<"4"^^xsd:float))'

def test_or():
kg = KnowledgeGraph()
struct_Fe = System.create.element.Fe(graph=kg)

term = (kg.ontology.terms.cmso.hasVolume > 2) | (kg.ontology.terms.cmso.hasVolume < 4)
assert term._condition == '((?cmso:hasVolumevalue>"2"^^xsd:float)||(?cmso:hasVolumevalue<"4"^^xsd:float))'
assert term._condition == '((?hasVolumevalue>"2"^^xsd:float)||(?hasVolumevalue<"4"^^xsd:float))'

0 comments on commit 86fc607

Please sign in to comment.