Skip to content

Commit

Permalink
modify test to cover issue
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jan 9, 2025
1 parent b8bd0eb commit 8f95e65
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions asdf/_tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,15 @@ def test_info_with_custom_extension(capsys):
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: {MY_SCHEMA_URI}
title: sentinel""".encode(
title: top_title
properties:
foo:
title: foo_title
type: object
properties:
bar:
title: bar_title
""".encode(
"ascii"
)

Expand All @@ -791,11 +799,15 @@ class MyExtension:
)
]

class FooThing:
def __asdf_traverse__(self):
return {"bar": 1}

class Thing:
_tag = MY_TAG_URI

def __asdf_traverse__(self):
return []
return {"foo": FooThing()}

with asdf.config_context() as cfg:
cfg.add_resource_mapping({MY_SCHEMA_URI: schema_bytes})
Expand All @@ -804,7 +816,9 @@ def __asdf_traverse__(self):
af.info(max_cols=None)

captured = capsys.readouterr()
assert "sentinel" in captured.out
assert "top_title" in captured.out
assert "foo_title" in captured.out
assert "bar_title" in captured.out


def test_info_no_infinite_loop(capsys):
Expand Down

0 comments on commit 8f95e65

Please sign in to comment.