From 2f24d88fac759338061ba884c45e4c3774e5bb0a Mon Sep 17 00:00:00 2001 From: Daniel M Date: Sat, 1 Jul 2023 19:39:14 -0400 Subject: [PATCH] fix:TestTransaction --- test/test_hypothesis.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/test/test_hypothesis.py b/test/test_hypothesis.py index a14d0dcd..b08beba7 100644 --- a/test/test_hypothesis.py +++ b/test/test_hypothesis.py @@ -512,15 +512,36 @@ class TestTransaction(BaseTest): transaction_commands = ( commands(st.sampled_from(['multi', 'discard', 'exec', 'unwatch'])) | commands(st.just('watch'), keys) + | commands(st.just('append'), keys, values) + | commands(st.just('bitcount'), keys) + | commands(st.just('bitcount'), keys, values, values) + | commands(st.sampled_from(['incr', 'decr']), keys) + | commands(st.sampled_from(['incrby', 'decrby']), keys, values) + | commands(st.just('get'), keys) + | commands(st.just('getbit'), keys, counts) + | commands(st.just('setbit'), keys, counts, + st.integers(min_value=0, max_value=1) | st.integers()) + | commands(st.sampled_from(['substr', 'getrange']), keys, counts, counts) + | commands(st.just('getset'), keys, values) + | commands(st.just('mget'), st.lists(keys)) + | commands(st.sampled_from(['mset', 'msetnx']), st.lists(st.tuples(keys, values))) + | commands(st.just('set'), keys, values, + st.none() | st.just('nx'), + st.none() | st.just('xx'), + st.none() | st.just('keepttl')) + | commands(st.just('setex'), keys, expires_seconds, values) + | commands(st.just('psetex'), keys, expires_ms, values) + | commands(st.just('setnx'), keys, values) + | commands(st.just('setrange'), keys, counts, values) + | commands(st.just('strlen'), keys) ) create_command_strategy = TestString.create_command_strategy - command_strategy = transaction_commands | TestString.string_commands | common_commands + command_strategy = transaction_commands | common_commands class TestServer(BaseTest): # TODO: real redis raises an error if there is a save already in progress. - # Find a better way to test this. - # commands(st.just('bgsave')) + # Find a better way to test this. commands(st.just('bgsave')) server_commands = ( commands(st.just('dbsize')) | commands(st.sampled_from(['flushdb', 'flushall']), st.sampled_from([[], 'async']))