(self)
| 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") |
nothing calls this directly
no test coverage detected