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

Function test_basic_store

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

Test that a basic store creates the expected database.

(mock_redis_cache)

Source from the content-addressed store, hash-verified

161
162
163def test_basic_store(mock_redis_cache):
164 """
165 Test that a basic store creates the expected database.
166 """
167 redis_server = redis_cache.__context__["cache.redis"]["client"]
168
169 redis_cache.store("minions/myhost", "grain", {"os": "Linux"})
170
171 expected = {
172 "$BANKS_": {"type": "sortedset", "data": {b"$KEYS_minions/myhost/": 0}},
173 "$KEYS_minions/myhost/": {
174 "type": "hash",
175 "data": {b"grain": b"\x81\xa2os\xa5Linux"},
176 },
177 "$TSTAMP_minions/myhost/": {"type": "hash", "data": {b"grain": b"\x00"}},
178 }
179 assert expected == redis_server.db
180
181
182def test_store_multiple(mock_redis_cache):

Callers

nothing calls this directly

Calls 1

storeMethod · 0.45

Tested by

no test coverage detected