From 8df39f7f181db8baa99422c8adf36f99d9725141 Mon Sep 17 00:00:00 2001 From: alphasentaurii Date: Wed, 4 Dec 2024 14:00:59 -0500 Subject: [PATCH] update doc test for asdf.rst --- docs/source/asdf.rst | 9 +++++---- tests/conftest.py | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/source/asdf.rst b/docs/source/asdf.rst index a3a08a34..038785c5 100644 --- a/docs/source/asdf.rst +++ b/docs/source/asdf.rst @@ -5,8 +5,9 @@ ASDF Schema .. _asdf-schema-1.1.0: -.. asdf-autoschemas:: - :schema_root: ../../resources/schemas - :standard_prefix: stsci.edu/asdf - asdf-schema-1.1.0 +.. asdf-schema:: + :schema_root: ../../resources/schemas/stsci.edu + :standard_prefix: + + asdf/asdf-schema-1.1.0 diff --git a/tests/conftest.py b/tests/conftest.py index 684439cd..6e573c41 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -89,6 +89,17 @@ def add_schemas(path, prefix, result): if len(possible_id) > 0: result.append(f"{prefix}{possible_id}") i += 1 + elif lines[i].startswith(".. asdf-schema::"): + i += 1 + while i < len(lines) and (lines[i].strip() == "" or lines[i].startswith(" ")): + if ":schema_root:" in lines[i].strip() or ":standard_prefix:" in lines[i].strip(): + i += 1 + else: + possible_id = lines[i].strip() + if len(possible_id) > 0: + possible_id = possible_id.split("/")[-1] + result.append(f"{prefix}{possible_id}") + i += 1 else: i += 1