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

Method test_comments_are_read

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

Source from the content-addressed store, hash-verified

39 assert Box.from_yaml(DOCUMENT).to_yaml() == DOCUMENT
40
41 def test_comments_are_read(self):
42 bx = Box.from_yaml(DOCUMENT)
43 assert bx.get_comment(None) == {"start": "Service settings\nsecond line\n", "end": "end of the document"}
44 assert bx.get_comment("name") == {"eol": "the name"}
45 assert bx.get_comment("server") == {"before": "Where to listen"}
46 assert bx.server.get_comment("host") == {"eol": "bind address"}
47 assert bx.server.get_comment("port") == {"before": ""} # the blank line
48 assert bx["items"].get_comment(0) == {"before": "first", "eol": "eol a"}
49 assert bx["items"].get_comment(1) is None
50 assert bx.get_comment("last") is None
51
52 def test_data_is_unaffected(self):
53 bx = Box.from_yaml(DOCUMENT)

Callers

nothing calls this directly

Calls 2

from_yamlMethod · 0.45
get_commentMethod · 0.45

Tested by

no test coverage detected