Skip to content

Commit

Permalink
Fix docstrings & add an additional test (#654)
Browse files Browse the repository at this point in the history
* Fix docstrings & add an additional test
  • Loading branch information
tetron authored Jan 25, 2023
1 parent 74aa7ae commit 5bb37c3
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions schema_salad/tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def test_namespaces_undeclared(caplog: pytest.LogCaptureFixture) -> None:


def test_not_a_namespace1(caplog: pytest.LogCaptureFixture) -> None:
"""Confirm warning message a namespace is used but not declared."""
"""Confirm no warning when relative id contains a colon but prefix doesn't look like a namespace."""

ldr, _, _, _ = schema_salad.schema.load_schema(
cmap(
Expand All @@ -404,7 +404,7 @@ def test_not_a_namespace1(caplog: pytest.LogCaptureFixture) -> None:


def test_not_a_namespace2(caplog: pytest.LogCaptureFixture) -> None:
"""Confirm warning message a namespace is used but not declared."""
"""Confirm no warning when relative id contains a colon but prefix doesn't look like a namespace."""

ldr, _, _, _ = schema_salad.schema.load_schema(
cmap(
Expand All @@ -425,6 +425,28 @@ def test_not_a_namespace2(caplog: pytest.LogCaptureFixture) -> None:
assert caplog.text == ""


def test_not_a_namespace3(caplog: pytest.LogCaptureFixture) -> None:
"""Confirm no warning when relative id starts with a colon."""

ldr, _, _, _ = schema_salad.schema.load_schema(
cmap(
{
"$base": "Y",
"name": "X",
"$graph": [
{
"name": ":ExampleType",
"type": "enum",
"symbols": ["asym", "bsym"],
}
],
}
)
)

assert caplog.text == ""


def test_schemas_type() -> None:
"""Confirm helpful error message when $schemas is the wrong type."""
path = get_data("tests/EDAM.owl")
Expand Down

0 comments on commit 5bb37c3

Please sign in to comment.