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

Method test_default_dots

test/test_box.py:1555–1568  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1553 assert len(list(a.keys())) == 2
1554
1555 def test_default_dots(self):
1556 bx1 = Box(default_box=True, box_dots=True, default_box_create_on_get=True)
1557 bx1["a.a.a"]
1558 assert bx1 == {"a": {"a": {"a": {}}}}
1559
1560 a = Box(default_box=True, box_dots=True, default_box_create_on_get=True)
1561 a["a."]
1562 a["a.."]
1563 assert a == {"a": {"": {"": {}}}}
1564 a["b.b"] = 3
1565 assert a == {"a": {"": {"": {}}}, "b": {"b": 3}}
1566 a.b.b = 4
1567 assert a == {"a": {"": {"": {}}}, "b": {"b": 4}}
1568 assert a["non.existent.key"] == {}
1569
1570 def test_merge_list_options(self):
1571 a = Box()

Callers

nothing calls this directly

Calls 1

BoxClass · 0.90

Tested by

no test coverage detected