Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Dec 13, 2023
1 parent 740cbea commit 641c7b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion linkml_runtime/utils/schemaview.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def permissible_value_children(self, permissible_value: str, enum_name: ENUM_NAM
children.append(isapv)
return children
else:
return []
raise ValueError(f'No such enum as "{enum_name}"')

Check warning on line 653 in linkml_runtime/utils/schemaview.py

View check run for this annotation

Codecov / codecov/patch

linkml_runtime/utils/schemaview.py#L653

Added line #L653 was not covered by tests

@lru_cache()
def slot_parents(self, slot_name: SLOT_NAME, imports=True, mixins=True, is_a=True) -> List[SlotDefinitionName]:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_utils/test_schemaview.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def test_all_aliases(self):

def test_schemaview_enums(self):
view = SchemaView(SCHEMA_NO_IMPORTS)
with self.assertRaises(ValueError):
view.permissible_value_parent("not_a_pv", "not_an_enum")
for en, e in view.all_enums().items():
if e.name == "Animals":
for pv, v in e.permissible_values.items():
Expand Down

0 comments on commit 641c7b5

Please sign in to comment.