MCPcopy Create free account
hub / github.com/cdgriffith/Box / test_list_transform_options

Method test_list_transform_options

test/test_edge_cases.py:780–789  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 2

listMethod · 0.95
ConfigBoxClass · 0.90

Tested by

no test coverage detected