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

Method test_merge_update

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

Source from the content-addressed store, hash-verified

269 assert "new" not in a.key1.keys()
270
271 def test_merge_update(self):
272 a = Box(test_dict)
273 a.grand = 1000
274 a.merge_update({"key1": {"new": 5}, "Key 2": {"add_key": 6}, "lister": ["a"]})
275 a.merge_update([("asdf", "fdsa")])
276 a.merge_update(testkey=66)
277 a.merge_update({"items": {"test": "pme"}})
278 a.merge_update({"key1": {"gg": 4}})
279 b = Box()
280 b.merge_update(item=1)
281 b.merge_update(E=4)
282 b.merge_update(__m=1)
283
284 assert a.grand == 1000
285 assert a["grand"] == 1000
286 assert isinstance(a["items"], Box)
287 assert a["items"].test == "pme"
288 assert a.key1.new == 5
289 assert a["Key 2"].add_key == 6
290 assert isinstance(a.key1, Box)
291 assert isinstance(a.lister, BoxList)
292 assert a.asdf == "fdsa"
293 assert a.testkey == 66
294 assert a.key1.new == 5
295 assert a.key1.gg == 4
296 with pytest.raises(ValueError):
297 b.merge_update("test")
298
299 def test_auto_attr(self):
300 a = Box(test_dict, default_box=True)

Callers

nothing calls this directly

Calls 2

merge_updateMethod · 0.95
BoxClass · 0.90

Tested by

no test coverage detected