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