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

Method test_box_modify_at_depth

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

Source from the content-addressed store, hash-verified

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