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

Method test_circular_references

test/test_box.py:836–847  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

834 assert my_box.movies.Robin_Hood_Men_in_Tights.Stars[0].name == "Richard Lewis"
835
836 def test_circular_references(self):
837 circular_dict = {}
838 circular_dict["a"] = circular_dict
839 bx = Box(circular_dict)
840 assert bx.a == {}
841 circular_dict_2 = bx.to_dict()
842 assert str(circular_dict_2) == "{'a': {}}"
843
844 bx2 = Box(circular_dict, k=circular_dict)
845 assert bx2.k.a == bx2.a
846
847 bx.to_json()
848
849 def test_to_multiline(self):
850 a = BoxList([Box(a=1), Box(b=2), Box(three=5)])

Callers

nothing calls this directly

Calls 3

to_dictMethod · 0.95
to_jsonMethod · 0.95
BoxClass · 0.90

Tested by

no test coverage detected