Skip to content

Commit

Permalink
adjust fixtures according to pr
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Oct 11, 2024
1 parent 1d0fd14 commit 1b5e9f7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_utils/test_schemaview.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_children_method(schema_view_no_imports):
assert children == ['Adult']


def test_all_aliases(vischema_view_no_imports):
def test_all_aliases(schema_view_no_imports):
"""
This tests the aliases slot (not: alias)
:return:
Expand Down Expand Up @@ -373,15 +373,17 @@ def test_caching():
assert len(['Y', 'Z', 'W']) == len(view.all_classes())


def test_import_map(view):
def test_import_map():
"""
Path to import file should be configurable
"""
for im in [{"core": "/no/such/file"}, {"linkml:": "/no/such/file"}]:
view = SchemaView(SCHEMA_WITH_IMPORTS, importmap=im)
with pytest.raises(FileNotFoundError):
view.all_classes()

for im in [None, {}, {"core": "core"}]:
view = SchemaView(SCHEMA_WITH_IMPORTS, importmap=im)
view.all_classes()
assert view.imports_closure().sort() == ['kitchen_sink', 'core', 'linkml:types'].sort() # Assert imports closure
assert ACTIVITY in view.all_classes() # Assert ACTIVITY is in all classes
Expand Down Expand Up @@ -789,12 +791,12 @@ def test_metamodel_in_schemaview():


def test_get_classes_by_slot(view):
slot = sv.get_slot(AGE_IN_YEARS)
actual_result = sv.get_classes_by_slot(slot)
slot = view.get_slot(AGE_IN_YEARS)
actual_result = view.get_classes_by_slot(slot)
expected_result = ["Person"]
assert sorted(actual_result) == sorted(expected_result)

actual_result = sv.get_classes_by_slot(slot, include_induced=True)
actual_result = view.get_classes_by_slot(slot, include_induced=True)
expected_result = ["Person", "Adult"]
assert sorted(actual_result) == sorted(expected_result)

Expand Down

0 comments on commit 1b5e9f7

Please sign in to comment.