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

Method test_box_modify_at_depth

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

Source from the content-addressed store, hash-verified

122 assert bx3.Test == 3
123
124 def test_box_modify_at_depth(self):
125 bx = Box(**test_dict)
126 assert "key1" in bx
127 assert "key2" not in bx
128 bx["Key 2"].new_thing = "test"
129 assert bx["Key 2"].new_thing == "test"
130 bx["Key 2"].new_thing += "2"
131 assert bx["Key 2"].new_thing == "test2"
132 assert bx["Key 2"].to_dict()["new_thing"] == "test2"
133 assert bx.to_dict()["Key 2"]["new_thing"] == "test2"
134 bx.__setattr__("key1", 1)
135 assert bx["key1"] == 1
136 bx.__delattr__("key1")
137 assert "key1" not in bx
138
139 def test_error_box(self):
140 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