summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortuxmaster5000 <837503+tuxmaster5000@users.noreply.github.com>2019-10-18 09:47:27 +0200
committerAndy McCurdy <andy@andymccurdy.com>2019-10-18 00:47:27 -0700
commit90532bd2c4d6d74110ab37d800653d7abafe2e0b (patch)
treecaac9bf029df6123f370be4835c611da2c22a53b
parent53772852558ae744c624c47d143e6e0506cd6aa3 (diff)
downloadredis-py-90532bd2c4d6d74110ab37d800653d7abafe2e0b.tar.gz
Support old EPEL-7 Redis. (#1227)
Fix test suite with Redis versions pre-5.0.0
-rw-r--r--tests/test_monitor.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_monitor.py b/tests/test_monitor.py
index 09ec21b..fe9e68a 100644
--- a/tests/test_monitor.py
+++ b/tests/test_monitor.py
@@ -1,5 +1,7 @@
from __future__ import unicode_literals
from redis._compat import unicode
+from .conftest import (skip_if_server_version_lt, skip_if_server_version_gte,
+ skip_unless_arch_bits)
def wait_for_command(client, monitor, command):
@@ -17,12 +19,14 @@ def wait_for_command(client, monitor, command):
class TestPipeline(object):
+ @skip_if_server_version_lt('5.0.0')
def test_wait_command_not_found(self, r):
"Make sure the wait_for_command func works when command is not found"
with r.monitor() as m:
response = wait_for_command(r, m, 'nothing')
assert response is None
+ @skip_if_server_version_lt('5.0.0')
def test_response_values(self, r):
with r.monitor() as m:
r.ping()
@@ -34,12 +38,14 @@ class TestPipeline(object):
assert isinstance(response['client_port'], unicode)
assert response['command'] == 'PING'
+ @skip_if_server_version_lt('5.0.0')
def test_command_with_quoted_key(self, r):
with r.monitor() as m:
r.get('foo"bar')
response = wait_for_command(r, m, 'GET foo"bar')
assert response['command'] == 'GET foo"bar'
+ @skip_if_server_version_lt('5.0.0')
def test_command_with_binary_data(self, r):
with r.monitor() as m:
byte_string = b'foo\x92'
@@ -47,6 +53,7 @@ class TestPipeline(object):
response = wait_for_command(r, m, 'GET foo\\x92')
assert response['command'] == 'GET foo\\x92'
+ @skip_if_server_version_lt('5.0.0')
def test_lua_script(self, r):
with r.monitor() as m:
script = 'return redis.call("GET", "foo")'