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

Method test_update_source_and_keywords

test/test_box.py:309–323  ·  view source on GitHub ↗
(self, source_type)

Source from the content-addressed store, hash-verified

307
308 @pytest.mark.parametrize("source_type", [dict, list, iter])
309 def test_update_source_and_keywords(self, source_type):
310 pairs = [("mode", "source"), ("service", {"timeout": 10})]
311 overrides = {"mode": "override", "workers": [{"id": 1}]}
312 expected = {"keep": True}
313 expected.update(source_type(pairs), **overrides)
314 bx = Box(keep=True)
315
316 assert bx.update(source_type(pairs), **overrides) is None
317
318 assert bx.to_dict() == expected
319 assert isinstance(bx.service, Box)
320 assert bx.service.timeout == 10
321 assert isinstance(bx.workers, BoxList)
322 assert isinstance(bx.workers[0], Box)
323 assert bx.workers[0].id == 1
324
325 def test_update_empty_source_and_keywords(self):
326 bx = Box(keep=True)

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
to_dictMethod · 0.95
BoxClass · 0.90

Tested by

no test coverage detected