(self)
| 1699 | assert box["f"][1] == 2 |
| 1700 | |
| 1701 | def test_setdefault_dots(self): |
| 1702 | box = Box({"a": 1}, box_dots=True) |
| 1703 | box.setdefault("b", 2) |
| 1704 | box.c = {"d": 3} |
| 1705 | box.setdefault("c.e", "test") |
| 1706 | box.setdefault("d", {"e": True}) |
| 1707 | box.setdefault("f", [1, 2]) |
| 1708 | |
| 1709 | assert box.b == 2 |
| 1710 | assert box.c.e == "test" |
| 1711 | assert isinstance(box["d"], Box) |
| 1712 | assert box.d.e == True # noqa: E712 |
| 1713 | assert isinstance(box["f"], BoxList) |
| 1714 | assert box.f[1] == 2 |
| 1715 | |
| 1716 | def test_setdefault_dots_default(self): |
| 1717 | box = Box({"a": 1}, box_dots=True, default_box=True) |
nothing calls this directly
no test coverage detected