-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathtest_server.py
More file actions
24 lines (22 loc) · 847 Bytes
/
test_server.py
File metadata and controls
24 lines (22 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from .base import (
BaseTest,
commands,
values,
st,
keys,
common_commands,
)
from .test_string import string_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'))
server_commands = (
commands(st.just("dbsize"))
# TODO: result is non-deterministic
# | commands(st.just('lastsave'))
| commands(st.just("save"))
)
command_strategy_dragonfly = commands(st.sampled_from(["flushdb", "flushall"]))
command_strategy_redis7 = commands(st.sampled_from(["flushdb", "flushall"]), st.sampled_from([[], "async"]))
create_command_strategy = commands(st.just("set"), keys, values)
command_strategy = server_commands | string_commands | common_commands