(self)
| 1620 | assert out2 == BoxList() |
| 1621 | |
| 1622 | def test_setdefault_simple(self): |
| 1623 | box = Box({"a": 1}) |
| 1624 | box.setdefault("b", 2) |
| 1625 | box.setdefault("c", "test") |
| 1626 | box.setdefault("d", {"e": True}) |
| 1627 | box.setdefault("f", [1, 2]) |
| 1628 | |
| 1629 | assert box["b"] == 2 |
| 1630 | assert box["c"] == "test" |
| 1631 | assert isinstance(box["d"], Box) |
| 1632 | assert box["d"]["e"] == True # noqa: E712 |
| 1633 | assert isinstance(box["f"], BoxList) |
| 1634 | assert box["f"][1] == 2 |
| 1635 | |
| 1636 | def test_setdefault_dots(self): |
| 1637 | box = Box({"a": 1}, box_dots=True) |
nothing calls this directly
no test coverage detected