(self)
| 183 | assert cb.to_dict() == {"SECTION": {"a": 1}} |
| 184 | |
| 185 | def test_frozen(self): |
| 186 | cb = ConfigBox({"Host": "h", "host": "x"}, frozen_box=True) |
| 187 | assert cb.to_dict() == {"host": "x"} |
| 188 | assert cb.HOST == "x" |
| 189 | for action in ( |
| 190 | lambda: cb.__setitem__("HOST", 1), |
| 191 | lambda: cb.update(HOST=1), |
| 192 | lambda: cb.merge_update(HOST=1), |
| 193 | lambda: cb.__delitem__("HOST"), |
| 194 | ): |
| 195 | with pytest.raises(BoxError): |
| 196 | action() |
| 197 | assert cb.to_dict() == {"host": "x"} |
| 198 | |
| 199 | def test_copy_pickle_round_trip(self): |
| 200 | cb = ConfigBox({"Host": "h", "Nested": {"Key": 1}}) |
nothing calls this directly
no test coverage detected