From bf0bba0abf26c6f356acfc5cb9f9a0c367d8710068109da7dc3a802dd5279bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 16 Dec 2019 08:02:58 +0000 Subject: [PATCH] Accepting request 756890 from home:buschmann23:branches:devel:languages:python - Fix tests with redis pre 5.0.0: * 0001-fix-tests-with-redis-pre-5.0.0.patch OBS-URL: https://build.opensuse.org/request/show/756890 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=50 --- 0001-fix-tests-with-redis-pre-5.0.0.patch | 62 +++++++++++++++++++++++ python-redis.changes | 6 +++ python-redis.spec | 2 + 3 files changed, 70 insertions(+) create mode 100644 0001-fix-tests-with-redis-pre-5.0.0.patch diff --git a/0001-fix-tests-with-redis-pre-5.0.0.patch b/0001-fix-tests-with-redis-pre-5.0.0.patch new file mode 100644 index 0000000..6040d6e --- /dev/null +++ b/0001-fix-tests-with-redis-pre-5.0.0.patch @@ -0,0 +1,62 @@ +From 90532bd2c4d6d74110ab37d800653d7abafe2e0b Mon Sep 17 00:00:00 2001 +From: tuxmaster5000 <837503+tuxmaster5000@users.noreply.github.com> +Date: Fri, 18 Oct 2019 09:47:27 +0200 +Subject: [PATCH] Support old EPEL-7 Redis. (#1227) +Upstream: merged(https://github.com/andymccurdy/redis-py/pull/1227) + +Fix test suite with Redis versions pre-5.0.0 + +--- + tests/test_monitor.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tests/test_monitor.py b/tests/test_monitor.py +index 09ec21bd..fe9e68a9 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 @@ def test_response_values(self, r): + 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 @@ def test_command_with_binary_data(self, r): + 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")' diff --git a/python-redis.changes b/python-redis.changes index 4921bed..93645e2 100644 --- a/python-redis.changes +++ b/python-redis.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Dec 13 19:00:52 UTC 2019 - Matthias Fehring + +- Fix tests with redis pre 5.0.0: + * 0001-fix-tests-with-redis-pre-5.0.0.patch + ------------------------------------------------------------------- Sun Nov 24 17:25:24 UTC 2019 - Arun Persaud diff --git a/python-redis.spec b/python-redis.spec index 886b4a3..55b07c6 100644 --- a/python-redis.spec +++ b/python-redis.spec @@ -25,6 +25,7 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/andymccurdy/redis-py Source: https://files.pythonhosted.org/packages/source/r/redis/redis-%{version}.tar.gz +Patch0: 0001-fix-tests-with-redis-pre-5.0.0.patch BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest >= 2.7.0} BuildRequires: %{python_module setuptools} @@ -42,6 +43,7 @@ The Python interface to the Redis key-value store. %prep %setup -q -n redis-%{version} +%patch0 -p1 %build %python_build