mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 12:51:25 -07:00
* better parsing of connection uri
* added changelog fragment
* fixed tests for ansible 2.9
* Update tests/unit/plugins/cache/test_redis.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/unit/plugins/cache/test_redis.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Adjustments from PR
* Update test_redis.py
* Update test_redis.py
* Update plugins/cache/redis.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/cache/redis.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/unit/plugins/cache/test_redis.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4764a5deba
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
4d6735bebf
commit
7426c3839e
3 changed files with 28 additions and 3 deletions
15
tests/unit/plugins/cache/test_redis.py
vendored
15
tests/unit/plugins/cache/test_redis.py
vendored
|
@ -23,10 +23,23 @@ import pytest
|
|||
|
||||
pytest.importorskip('redis')
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.plugins.loader import cache_loader
|
||||
from ansible.release import __version__ as ansible_version
|
||||
from ansible_collections.community.general.plugins.cache.redis import CacheModule as RedisCache
|
||||
|
||||
|
||||
def test_redis_cachemodule():
|
||||
# The _uri option is required for the redis plugin
|
||||
assert isinstance(cache_loader.get('community.general.redis', **{'_uri': '127.0.0.1:6379:1'}), RedisCache)
|
||||
connection = '127.0.0.1:6379:1'
|
||||
if ansible_version.startswith('2.9.'):
|
||||
C.CACHE_PLUGIN_CONNECTION = connection
|
||||
assert isinstance(cache_loader.get('community.general.redis', **{'_uri': connection}), RedisCache)
|
||||
|
||||
|
||||
def test_redis_cachemodule():
|
||||
# The _uri option is required for the redis plugin
|
||||
connection = '[::1]:6379:1'
|
||||
if ansible_version.startswith('2.9.'):
|
||||
C.CACHE_PLUGIN_CONNECTION = connection
|
||||
assert isinstance(cache_loader.get('community.general.redis', **{'_uri': connection}), RedisCache)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue