summaryrefslogtreecommitdiff
path: root/tests/test_pipeline.py
diff options
context:
space:
mode:
authorBar Shaul <88437685+barshaul@users.noreply.github.com>2021-11-25 14:15:24 +0200
committerGitHub <noreply@github.com>2021-11-25 14:15:24 +0200
commit9db1eec71b443b8e7e74ff503bae651dc6edf411 (patch)
treece23ac6f923df54676349603f4e5551dfc801057 /tests/test_pipeline.py
parent021d4ac0edaecedb9b83235700cc4699cb119ef1 (diff)
downloadredis-py-9db1eec71b443b8e7e74ff503bae651dc6edf411.tar.gz
Adding RedisCluster client to support Redis Cluster Mode (#1660)
Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: Anas <anas.el.amraoui@live.com>
Diffstat (limited to 'tests/test_pipeline.py')
-rw-r--r--tests/test_pipeline.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index 08bd40b..a759bc9 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -59,6 +59,7 @@ class TestPipeline:
assert r['b'] == b'b1'
assert r['c'] == b'c1'
+ @pytest.mark.onlynoncluster
def test_pipeline_no_transaction_watch(self, r):
r['a'] = 0
@@ -70,6 +71,7 @@ class TestPipeline:
pipe.set('a', int(a) + 1)
assert pipe.execute() == [True]
+ @pytest.mark.onlynoncluster
def test_pipeline_no_transaction_watch_failure(self, r):
r['a'] = 0
@@ -129,6 +131,7 @@ class TestPipeline:
assert pipe.set('z', 'zzz').execute() == [True]
assert r['z'] == b'zzz'
+ @pytest.mark.onlynoncluster
def test_transaction_with_empty_error_command(self, r):
"""
Commands with custom EMPTY_ERROR functionality return their default
@@ -143,6 +146,7 @@ class TestPipeline:
assert result[1] == []
assert result[2]
+ @pytest.mark.onlynoncluster
def test_pipeline_with_empty_error_command(self, r):
"""
Commands with custom EMPTY_ERROR functionality return their default
@@ -171,6 +175,7 @@ class TestPipeline:
assert pipe.set('z', 'zzz').execute() == [True]
assert r['z'] == b'zzz'
+ @pytest.mark.onlynoncluster
def test_parse_error_raised_transaction(self, r):
with r.pipeline() as pipe:
pipe.multi()
@@ -186,6 +191,7 @@ class TestPipeline:
assert pipe.set('z', 'zzz').execute() == [True]
assert r['z'] == b'zzz'
+ @pytest.mark.onlynoncluster
def test_watch_succeed(self, r):
r['a'] = 1
r['b'] = 2
@@ -203,6 +209,7 @@ class TestPipeline:
assert pipe.execute() == [True]
assert not pipe.watching
+ @pytest.mark.onlynoncluster
def test_watch_failure(self, r):
r['a'] = 1
r['b'] = 2
@@ -217,6 +224,7 @@ class TestPipeline:
assert not pipe.watching
+ @pytest.mark.onlynoncluster
def test_watch_failure_in_empty_transaction(self, r):
r['a'] = 1
r['b'] = 2
@@ -230,6 +238,7 @@ class TestPipeline:
assert not pipe.watching
+ @pytest.mark.onlynoncluster
def test_unwatch(self, r):
r['a'] = 1
r['b'] = 2
@@ -242,6 +251,7 @@ class TestPipeline:
pipe.get('a')
assert pipe.execute() == [b'1']
+ @pytest.mark.onlynoncluster
def test_watch_exec_no_unwatch(self, r):
r['a'] = 1
r['b'] = 2
@@ -262,6 +272,7 @@ class TestPipeline:
unwatch_command = wait_for_command(r, m, 'UNWATCH')
assert unwatch_command is None, "should not send UNWATCH"
+ @pytest.mark.onlynoncluster
def test_watch_reset_unwatch(self, r):
r['a'] = 1
@@ -276,6 +287,7 @@ class TestPipeline:
assert unwatch_command is not None
assert unwatch_command['command'] == 'UNWATCH'
+ @pytest.mark.onlynoncluster
def test_transaction_callable(self, r):
r['a'] = 1
r['b'] = 2
@@ -300,6 +312,7 @@ class TestPipeline:
assert result == [True]
assert r['c'] == b'4'
+ @pytest.mark.onlynoncluster
def test_transaction_callable_returns_value_from_callable(self, r):
def callback(pipe):
# No need to do anything here since we only want the return value
@@ -354,6 +367,7 @@ class TestPipeline:
assert pipe == pipe2
assert response == [True, [0, 0, 15, 15, 14], b'1']
+ @pytest.mark.onlynoncluster
@skip_if_server_version_lt('2.0.0')
def test_pipeline_discard(self, r):