From d71fd6264d58795c50b9350d7c39677b671e0896 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 17 Jul 2021 09:34:48 +0200 Subject: Merging upstream version 1.9.4. Signed-off-by: Daniel Baumann --- tests/cli_tests/test_command_input.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tests/cli_tests/test_command_input.py') diff --git a/tests/cli_tests/test_command_input.py b/tests/cli_tests/test_command_input.py index 4f970f5..f70ee3c 100644 --- a/tests/cli_tests/test_command_input.py +++ b/tests/cli_tests/test_command_input.py @@ -1,3 +1,4 @@ +import os import pytest @@ -8,8 +9,13 @@ def test_wrong_select_db_index(cli): cli.sendline("select 128") cli.expect(["DB index is out of range", "127.0.0.1:6379[1]>"]) + if int(os.environ["REDIS_VERSION"]) > 5: + text = "value is not an integer or out of range" + else: + text = "invalid DB index" + cli.sendline("select abc") - cli.expect(["invalid DB index", "127.0.0.1:6379[1]>"]) + cli.expect([text, "127.0.0.1:6379[1]>"]) cli.sendline("select 15") cli.expect("OK") @@ -53,3 +59,16 @@ def test_auth_hidden_password(clean_redis, cli): def test_hello_command_is_not_supported(cli): cli.sendline("hello 3") cli.expect("IRedis currently not support RESP3") + + +def test_abort_reading_connection(cli): + cli.sendline("blpop mylist 30") + cli.send(chr(3)) + cli.expect( + r"KeyboardInterrupt received! User canceled reading response!", timeout=10 + ) + + cli.sendline("set foo bar") + cli.expect("OK") + cli.sendline("get foo") + cli.expect("bar") -- cgit v1.2.3