(self)
| 1336 | assert out2 == BoxList() |
| 1337 | |
| 1338 | def test_setdefault_simple(self): |
| 1339 | box = Box({"a": 1}) |
| 1340 | box.setdefault("b", 2) |
| 1341 | box.setdefault("c", "test") |
| 1342 | box.setdefault("d", {"e": True}) |
| 1343 | box.setdefault("f", [1, 2]) |
| 1344 | |
| 1345 | assert box["b"] == 2 |
| 1346 | assert box["c"] == "test" |
| 1347 | assert isinstance(box["d"], Box) |
| 1348 | assert box["d"]["e"] == True |
| 1349 | assert isinstance(box["f"], BoxList) |
| 1350 | assert box["f"][1] == 2 |
| 1351 | |
| 1352 | def test_setdefault_dots(self): |
| 1353 | box = Box({"a": 1}, box_dots=True) |
nothing calls this directly
no test coverage detected