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

Method test_default_dots

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

Source from the content-addressed store, hash-verified

1618 assert len(list(a.keys())) == 2
1619
1620 def test_default_dots(self):
1621 bx1 = Box(default_box=True, box_dots=True, default_box_create_on_get=True)
1622 bx1["a.a.a"]
1623 assert bx1 == {"a": {"a": {"a": {}}}}
1624
1625 a = Box(default_box=True, box_dots=True, default_box_create_on_get=True)
1626 a["a."]
1627 a["a.."]
1628 assert a == {"a": {"": {"": {}}}}
1629 a["b.b"] = 3
1630 assert a == {"a": {"": {"": {}}}, "b": {"b": 3}}
1631 a.b.b = 4
1632 assert a == {"a": {"": {"": {}}}, "b": {"b": 4}}
1633 assert a["non.existent.key"] == {}
1634
1635 def test_merge_list_options(self):
1636 a = Box()

Callers

nothing calls this directly

Calls 1

BoxClass · 0.90

Tested by

no test coverage detected