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

Method test_self_reference

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

Source from the content-addressed store, hash-verified

408 assert bx.to_dict() == {"a": {"b": {"c": 1}}}
409
410 def test_self_reference(self):
411 bx = Box(a=1)
412 dict.__setitem__(bx, "me", bx) # Box itself never builds cycles, guard against them anyway
413 assert bx.to_yaml() == "&id001\na: 1\nme: *id001\n"
414 bx.set_comment("a", "x")
415 assert "a: 1 # x" in bx.to_yaml()
416
417
418class TestCommentTextIsNeverYaml:

Callers

nothing calls this directly

Calls 4

to_yamlMethod · 0.95
set_commentMethod · 0.95
BoxClass · 0.90
__setitem__Method · 0.45

Tested by

no test coverage detected