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

Method test_default_box_none_transforms

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

Source from the content-addressed store, hash-verified

710
711 # Issue#59 https://github.com/cdgriffith/Box/issues/59 "Treat None values as non existing keys for default_box"
712 def test_default_box_none_transforms(self):
713 bx4 = Box({"noneValue": None, "inner": {"noneInner": None}}, default_box=True, default_box_attr="issue#59")
714 assert bx4.noneValue == "issue#59"
715 assert bx4.inner.noneInner == "issue#59"
716
717 bx5 = Box(
718 {"noneValue": None, "inner": {"noneInner": None}},
719 default_box=True,
720 default_box_none_transform=False,
721 default_box_attr="attr",
722 )
723 assert bx5.noneValue is None
724 assert bx5.absentKey == "attr"
725 assert bx5.inner.noneInner is None
726
727 def test_camel_killer_box(self):
728 td = extended_test_dict.copy()

Callers

nothing calls this directly

Calls 1

BoxClass · 0.90

Tested by

no test coverage detected