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

Method test_frozen

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

Source from the content-addressed store, hash-verified

195 setattr(Box(), name, 1)
196
197 def test_frozen(self):
198 bx = Box.from_yaml("a: 1 # kept\n", frozen_box=True)
199 assert bx.get_comment("a") == {"eol": "kept"}
200 with pytest.raises(BoxError, match="frozen"):
201 bx.set_comment("a", "x")
202 with pytest.raises(BoxError, match="frozen"):
203 bx.del_comment("a")
204 bl = BoxList([1], frozen_box=True)
205 with pytest.raises(BoxError, match="frozen"):
206 bl.set_comment(0, "x")
207
208
209class TestKeepingCommentsInSync:

Callers

nothing calls this directly

Calls 6

set_commentMethod · 0.95
BoxListClass · 0.90
from_yamlMethod · 0.45
get_commentMethod · 0.45
set_commentMethod · 0.45
del_commentMethod · 0.45

Tested by

no test coverage detected