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

Method test_default_box_none_transforms

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

Source from the content-addressed store, hash-verified

661
662 # Issue#59 https://github.com/cdgriffith/Box/issues/59 "Treat None values as non existing keys for default_box"
663 def test_default_box_none_transforms(self):
664 bx4 = Box({"noneValue": None, "inner": {"noneInner": None}}, default_box=True, default_box_attr="issue#59")
665 assert bx4.noneValue == "issue#59"
666 assert bx4.inner.noneInner == "issue#59"
667
668 bx5 = Box(
669 {"noneValue": None, "inner": {"noneInner": None}},
670 default_box=True,
671 default_box_none_transform=False,
672 default_box_attr="attr",
673 )
674 assert bx5.noneValue is None
675 assert bx5.absentKey == "attr"
676 assert bx5.inner.noneInner is None
677
678 def test_camel_killer_box(self):
679 td = extended_test_dict.copy()

Callers

nothing calls this directly

Calls 1

BoxClass · 0.90

Tested by

no test coverage detected