summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 3132903..208b99b 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -12,7 +12,7 @@ from redis.client import parse_info
from redis import exceptions
from .conftest import (skip_if_server_version_lt, skip_if_server_version_gte,
- skip_unless_arch_bits)
+ skip_unless_arch_bits, REDIS_6_VERSION)
@pytest.fixture()
@@ -65,19 +65,19 @@ class TestRedisCommands(object):
r['a']
# SERVER INFORMATION
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_cat_no_category(self, r):
categories = r.acl_cat()
assert isinstance(categories, list)
assert 'read' in categories
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_cat_with_category(self, r):
commands = r.acl_cat('read')
assert isinstance(commands, list)
assert 'get' in commands
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_deluser(self, r, request):
username = 'redis-py-user'
@@ -90,12 +90,12 @@ class TestRedisCommands(object):
assert r.acl_setuser(username, enabled=False, reset=True)
assert r.acl_deluser(username) == 1
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_genpass(self, r):
password = r.acl_genpass()
assert isinstance(password, basestring)
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_getuser_setuser(self, r, request):
username = 'redis-py-user'
@@ -183,7 +183,7 @@ class TestRedisCommands(object):
hashed_passwords=['-' + hashed_password])
assert len(r.acl_getuser(username)['passwords']) == 1
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_list(self, r, request):
username = 'redis-py-user'
@@ -195,7 +195,7 @@ class TestRedisCommands(object):
users = r.acl_list()
assert 'user %s off -@all' % username in users
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_setuser_categories_without_prefix_fails(self, r, request):
username = 'redis-py-user'
@@ -206,7 +206,7 @@ class TestRedisCommands(object):
with pytest.raises(exceptions.DataError):
r.acl_setuser(username, categories=['list'])
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_setuser_commands_without_prefix_fails(self, r, request):
username = 'redis-py-user'
@@ -217,7 +217,7 @@ class TestRedisCommands(object):
with pytest.raises(exceptions.DataError):
r.acl_setuser(username, commands=['get'])
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_setuser_add_passwords_and_nopass_fails(self, r, request):
username = 'redis-py-user'
@@ -228,13 +228,13 @@ class TestRedisCommands(object):
with pytest.raises(exceptions.DataError):
r.acl_setuser(username, passwords='+mypass', nopass=True)
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_users(self, r):
users = r.acl_users()
assert isinstance(users, list)
assert len(users) > 0
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_acl_whoami(self, r):
username = r.acl_whoami()
assert isinstance(username, basestring)
@@ -867,7 +867,7 @@ class TestRedisCommands(object):
assert r.set('a', '1', xx=True, px=10000)
assert 0 < r.ttl('a') <= 10
- @skip_if_server_version_lt('5.9.0') # 6.0-rc1
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_set_keepttl(self, r):
r['a'] = 'val'
assert r.set('a', '1', xx=True, px=10000)
@@ -1073,7 +1073,7 @@ class TestRedisCommands(object):
_, keys = r.scan(match='a')
assert set(keys) == {b'a'}
- @skip_if_server_version_lt('5.9.101')
+ @skip_if_server_version_lt(REDIS_6_VERSION)
def test_scan_type(self, r):
r.sadd('a-set', 1)
r.hset('a-hash', 'foo', 2)