Skip to content

Commit 8f95e65

Browse files
committed
modify test to cover issue
1 parent b8bd0eb commit 8f95e65

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

asdf/_tests/test_info.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,15 @@ def test_info_with_custom_extension(capsys):
778778
---
779779
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
780780
id: {MY_SCHEMA_URI}
781-
title: sentinel""".encode(
781+
title: top_title
782+
properties:
783+
foo:
784+
title: foo_title
785+
type: object
786+
properties:
787+
bar:
788+
title: bar_title
789+
""".encode(
782790
"ascii"
783791
)
784792

@@ -791,11 +799,15 @@ class MyExtension:
791799
)
792800
]
793801

802+
class FooThing:
803+
def __asdf_traverse__(self):
804+
return {"bar": 1}
805+
794806
class Thing:
795807
_tag = MY_TAG_URI
796808

797809
def __asdf_traverse__(self):
798-
return []
810+
return {"foo": FooThing()}
799811

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

806818
captured = capsys.readouterr()
807-
assert "sentinel" in captured.out
819+
assert "top_title" in captured.out
820+
assert "foo_title" in captured.out
821+
assert "bar_title" in captured.out
808822

809823

810824
def test_info_no_infinite_loop(capsys):

0 commit comments

Comments
 (0)