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

Function test_existing_fields_remain_mutable

test/test_strict_box.py:12–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def test_existing_fields_remain_mutable():
13 settings = StrictBox(host="localhost", port=8000, optional=None, tags=[])
14 settings.port = 8080
15 settings.optional = "set"
16 settings.tags.append("local")
17 with pytest.raises(BoxKeyError, match="Cannot create field"):
18 settings.prot = 8080
19 assert settings.to_dict() == {
20 "host": "localhost",
21 "port": 8080,
22 "optional": "set",
23 "tags": ["local"],
24 }
25
26
27@pytest.mark.parametrize("method", ["item", "update", "merge_update", "setdefault", "union"])

Callers

nothing calls this directly

Calls 3

StrictBoxClass · 0.90
appendMethod · 0.80
to_dictMethod · 0.80

Tested by

no test coverage detected