summaryrefslogtreecommitdiffstats
path: root/tests/cli_tests/test_string_execute.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-21 10:28:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:16:53 +0000
commit06cba6ccd165ca8b224797e37fccb9e63f026d77 (patch)
treee82f1bc439997ae296f2e74f8a64d84c5d95f140 /tests/cli_tests/test_string_execute.py
parentInitial commit. (diff)
downloadiredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.tar.xz
iredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.zip
Adding upstream version 1.9.1.upstream/1.9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/cli_tests/test_string_execute.py')
-rw-r--r--tests/cli_tests/test_string_execute.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/cli_tests/test_string_execute.py b/tests/cli_tests/test_string_execute.py
new file mode 100644
index 0000000..310adab
--- /dev/null
+++ b/tests/cli_tests/test_string_execute.py
@@ -0,0 +1,39 @@
+def test_set(cli):
+ cli.sendline("set foo bar")
+ cli.expect(["OK", "127.0.0.1"])
+
+ cli.sendline("set foo bar nx")
+ cli.expect(["(nil)", "127.0.0.1"])
+
+ cli.sendline("set foo bar xx")
+ cli.expect(["OK", "127.0.0.1"])
+
+ cli.sendline("set foo1 bar xx")
+ cli.expect(["(nil)", "127.0.0.1"])
+
+
+def test_get(cli):
+ cli.sendline("set foo bar")
+ cli.expect("OK")
+
+ cli.sendline("get foo")
+ cli.expect('"bar"')
+
+
+def test_delete_string(clean_redis, cli, config):
+ config.warning = True
+ cli.sendline("set foo bar")
+ cli.expect("OK")
+ cli.sendline("del foo")
+ cli.expect("Do you want to proceed")
+ cli.sendline("yes")
+ cli.expect("1")
+
+ cli.sendline("get foo")
+ cli.expect("(nil)")
+
+
+def test_on_dangerous_commands(cli, config):
+ config.warning = True
+ cli.sendline("keys *")
+ cli.expect("KEYS will hang redis server, use SCAN instead")