MCPcopy Create free account
hub / github.com/cdgriffith/Box / test_nested_list_of_maps

Method test_nested_list_of_maps

test/test_comments.py:77–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

75 assert bx.to_yaml() == "server:\n # inside\n host: x\n"
76
77 def test_nested_list_of_maps(self):
78 src = "items:\n- a: 1 # one\n b: 2\n# second item\n- a: 3\n"
79 bx = Box.from_yaml(src)
80 assert bx["items"][0].get_comment("a") == {"eol": "one"}
81 assert bx["items"].get_comment(1) == {"before": "second item"}
82 assert bx.to_yaml() == src
83
84 def test_document_without_comments_has_none(self):
85 bx = Box.from_yaml("a: 1\nb: [1, 2]\n")

Callers

nothing calls this directly

Calls 3

from_yamlMethod · 0.45
get_commentMethod · 0.45
to_yamlMethod · 0.45

Tested by

no test coverage detected