diff --git a/tests/examples/test_node.py b/tests/examples/test_node.py index 6c248d0..09cdb6d 100644 --- a/tests/examples/test_node.py +++ b/tests/examples/test_node.py @@ -74,6 +74,13 @@ class TestExtension(Extension): yield asdf_config +@pytest.mark.usefixtures("asdf_extension") +def test_check_schema(): + """Tests the model schema is correct.""" + schema = yaml.safe_load(AsdfNode.model_asdf_schema()) + asdf.schema.check_schema(schema) + + @pytest.mark.usefixtures("asdf_extension") def test_can_write_valid_asdf_file(tmp_path): """Tests using the model to write an ASDF file validates its own schema.""" diff --git a/tests/examples/test_rectangle.py b/tests/examples/test_rectangle.py index 77adefc..a95a2ba 100644 --- a/tests/examples/test_rectangle.py +++ b/tests/examples/test_rectangle.py @@ -2,6 +2,7 @@ from unittest.mock import MagicMock, patch import asdf +import asdf.schema import pytest import yaml from asdf.extension import Extension @@ -38,6 +39,13 @@ class TestExtension(Extension): yield asdf_config +@pytest.mark.usefixtures("asdf_extension") +def test_check_schema(): + """Tests the model schema is correct.""" + schema = yaml.safe_load(AsdfRectangle.model_asdf_schema()) + asdf.schema.check_schema(schema) + + @pytest.mark.usefixtures("asdf_extension") def test_can_write_valid_asdf_file(tmp_path): """Tests using the model to write an ASDF file validates its own schema."""