MCPcopy Create free account
hub / github.com/saltstack/salt / test_list_simple

Function test_list_simple

tests/pytests/unit/cache/test_redis_cache.py:352–363  ·  view source on GitHub ↗

Test that the list works correctly.

(mock_redis_cache)

Source from the content-addressed store, hash-verified

350
351
352def test_list_simple(mock_redis_cache):
353 """
354 Test that the list works correctly.
355 """
356 redis_server = redis_cache.__context__["cache.redis"]["client"]
357
358 redis_cache.store("minions/myhost", "grain", {"os": "Linux"})
359 redis_cache.store("minions/myhost/vm", "gain", {"os": "Windows"})
360 redis_cache.store("minions/yourhost", "grain", {"os": "MacOS"})
361
362 assert {"vm", "grain"} == set(redis_cache.list_("minions/myhost"))
363 assert {"myhost", "yourhost"} == set(redis_cache.list_("minions"))

Callers

nothing calls this directly

Calls 2

setFunction · 0.50
storeMethod · 0.45

Tested by

no test coverage detected