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

Method test_box_modify_at_depth

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

Source from the content-addressed store, hash-verified

159 assert bx3.Test == 3
160
161 def test_box_modify_at_depth(self):
162 bx = Box(**test_dict)
163 assert "key1" in bx
164 assert "key2" not in bx
165 bx["Key 2"].new_thing = "test"
166 assert bx["Key 2"].new_thing == "test"
167 bx["Key 2"].new_thing += "2"
168 assert bx["Key 2"].new_thing == "test2"
169 assert bx["Key 2"].to_dict()["new_thing"] == "test2"
170 assert bx.to_dict()["Key 2"]["new_thing"] == "test2"
171 bx.__setattr__("key1", 1)
172 assert bx["key1"] == 1
173 bx.__delattr__("key1")
174 assert "key1" not in bx
175
176 def test_error_box(self):
177 bx = Box(**test_dict)

Callers

nothing calls this directly

Calls 4

to_dictMethod · 0.95
__setattr__Method · 0.95
__delattr__Method · 0.95
BoxClass · 0.90

Tested by

no test coverage detected