MCPcopy
hub / github.com/saltstack/salt / test_client_cache_missing_key

Function test_client_cache_missing_key

tests/pytests/unit/utils/test_reactor2.py:565–586  ·  view source on GitHub ↗

Test client_cache file_client missing, gets repopulated

(file_client, react_wrap)

Source from the content-addressed store, hash-verified

563
564@pytest.mark.parametrize("file_client", ["runner", "wheel"])
565def test_client_cache_missing_key(file_client, react_wrap):
566 """
567 Test client_cache file_client missing, gets repopulated
568 """
569 client_cache = {}
570 tag = f"new_{file_client}"
571 chunk = LOW_CHUNKS[tag][0]
572 with patch.object(react_wrap, "client_cache", client_cache):
573 if f"{file_client}" == "runner":
574 react_wrap.runner(chunk)
575 elif f"{file_client}" == "wheel":
576 react_wrap.wheel(chunk)
577 else:
578 # catch need for new check
579 assert f"{file_client}" == "bad parameterization"
580
581 file_client_key = None
582 for key in react_wrap.client_cache.keys():
583 if key == f"{file_client}":
584 file_client_key = key
585
586 assert file_client_key == f"{file_client}"

Callers

nothing calls this directly

Calls 3

runnerMethod · 0.45
wheelMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected