summaryrefslogtreecommitdiff
path: root/tests/test_pipeline.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2019-12-29 16:33:02 -0800
committerAndy McCurdy <andy@andymccurdy.com>2019-12-29 16:33:02 -0800
commit9cbb48aaa31752f8d707af9b4ec8c90a48e7f8bb (patch)
tree3eb3c2d062595bc447627615a8b8c80ca02045e4 /tests/test_pipeline.py
parentff69f0d77284643909462ee6d1e37233c6677672 (diff)
downloadredis-py-9cbb48aaa31752f8d707af9b4ec8c90a48e7f8bb.tar.gz
Add test for pipeline.transaction(value_from_callable=True)
Diffstat (limited to 'tests/test_pipeline.py')
-rw-r--r--tests/test_pipeline.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index 08b7fba..867666b 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -242,6 +242,14 @@ class TestPipeline(object):
assert result == [True]
assert r['c'] == b'4'
+ 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
+ return 'a'
+
+ res = r.transaction(callback, 'my-key', value_from_callable=True)
+ assert res == 'a'
+
def test_exec_error_in_no_transaction_pipeline(self, r):
r['a'] = 1
with r.pipeline(transaction=False) as pipe: