Test that a basic store creates the expected database.
(mock_redis_cache)
| 161 | |
| 162 | |
| 163 | def 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 | |
| 182 | def test_store_multiple(mock_redis_cache): |