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

Method test_circular_references

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

Source from the content-addressed store, hash-verified

785 assert my_box.movies.Robin_Hood_Men_in_Tights.Stars[0].name == "Richard Lewis"
786
787 def test_circular_references(self):
788 circular_dict = {}
789 circular_dict["a"] = circular_dict
790 bx = Box(circular_dict)
791 assert bx.a == {}
792 circular_dict_2 = bx.to_dict()
793 assert str(circular_dict_2) == "{'a': {}}"
794
795 bx2 = Box(circular_dict, k=circular_dict)
796 assert bx2.k.a == bx2.a
797
798 bx.to_json()
799
800 def test_to_multiline(self):
801 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