(self)
| 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) |
nothing calls this directly
no test coverage detected