(self)
| 1634 | assert box["f"][1] == 2 |
| 1635 | |
| 1636 | def test_setdefault_dots(self): |
| 1637 | box = Box({"a": 1}, box_dots=True) |
| 1638 | box.setdefault("b", 2) |
| 1639 | box.c = {"d": 3} |
| 1640 | box.setdefault("c.e", "test") |
| 1641 | box.setdefault("d", {"e": True}) |
| 1642 | box.setdefault("f", [1, 2]) |
| 1643 | |
| 1644 | assert box.b == 2 |
| 1645 | assert box.c.e == "test" |
| 1646 | assert isinstance(box["d"], Box) |
| 1647 | assert box.d.e == True # noqa: E712 |
| 1648 | assert isinstance(box["f"], BoxList) |
| 1649 | assert box.f[1] == 2 |
| 1650 | |
| 1651 | def test_setdefault_dots_default(self): |
| 1652 | box = Box({"a": 1}, box_dots=True, default_box=True) |
nothing calls this directly
no test coverage detected