| 778 | cfg.bool("missing") |
| 779 | |
| 780 | def test_list_transform_options(self): |
| 781 | cfg = ConfigBox(a=" 1, 2 ,3 ", b="[x;y]", c="5") |
| 782 | assert cfg.list("a") == ["1", "2", "3"] |
| 783 | assert cfg.list("a", mod=int) == [1, 2, 3] |
| 784 | assert cfg.list("a", strip=False) == [" 1", " 2 ", "3 "] |
| 785 | assert cfg.list("b", spliter=";") == ["x", "y"] |
| 786 | assert cfg.list("c") == ["5"] |
| 787 | assert cfg.list("missing", default=["d"]) == ["d"] |
| 788 | with pytest.raises(BoxKeyError): |
| 789 | cfg.list("missing") |
| 790 | |
| 791 | def test_case_insensitive_with_nested_boxes_and_box_dots(self): |
| 792 | cfg = ConfigBox({"Server": {"Port": "80", "Hosts": {"Main": "a"}}}, box_dots=True) |