| 1066 | Box(box_dots=False).items(dotted=True) |
| 1067 | |
| 1068 | def test_get(self): |
| 1069 | bx = Box() |
| 1070 | bx["c"] = {} |
| 1071 | assert bx.get("a") is None |
| 1072 | assert isinstance(bx.get("c"), Box) |
| 1073 | assert isinstance(bx.get("b", {}), Box) |
| 1074 | assert "a" in bx.get("a", Box(a=1, conversion_box=False)) |
| 1075 | assert isinstance(bx.get("a", [1, 2]), BoxList) |
| 1076 | bx_dot = Box(a=Box(b=Box(c="me!")), box_dots=True) |
| 1077 | assert bx_dot.get("a.b.c") == "me!" |
| 1078 | assert bx_dot.get("def.not.in.the.box", 4) == 4 |
| 1079 | |
| 1080 | def test_get_default_keeps_box_config(self): |
| 1081 | bx = Box(box_dots=True, default_box=True, camel_killer_box=True) |