-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
938dbb4
commit 6d83771
Showing
3 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Test Ontology class methods.""" | ||
|
||
from ontopy import get_ontology | ||
from ontopy.testutils import ontodir | ||
|
||
animal = get_ontology(ontodir / "animal.ttl").load() | ||
|
||
|
||
# if True: | ||
def test_find(): | ||
"""Test find() method.""" | ||
m1 = (animal.chasing, animal.prefLabel, "chasing") | ||
for domain in "ontology", "imported", "world": | ||
assert m1 in animal.find("chas", domain=domain) | ||
assert m1 in animal.find("chas", domain=domain, regex=True) | ||
assert m1 in animal.find("chas", domain=domain, case_sensitive=True) | ||
assert m1 in animal.find( | ||
"chas", domain=domain, regex=True, case_sensitive=True | ||
) | ||
|
||
assert m1 in animal.find("Chas", domain=domain) | ||
assert m1 in animal.find("Chas", domain=domain, regex=True) | ||
assert m1 not in animal.find("Chas", domain=domain, case_sensitive=True) | ||
assert m1 not in animal.find( | ||
"Chas", domain=domain, regex=True, case_sensitive=True | ||
) |