Debian Codegraph @

tests/cli_tests/test_shell_pipeline.py

raw
1 import pexpect
2
3
4 def test_running_disable_shell_pipeline():
5 cli = pexpect.spawn("iredis -n 15 --no-shell", timeout=2)
6 cli.expect("127.0.0.1")
7 cli.sendline("set foo hello")
8 cli.expect("OK")
9 cli.sendline("get foo | grep w")
10 cli.expect(r"hello")
11 cli.close()
12
13
14 def test_running_disable_shell_pipeline_with_decode_option():
15 cli = pexpect.spawn("iredis -n 15 --decode=utf-8", timeout=2)
16 cli.expect("127.0.0.1")
17 cli.sendline("set foo hello")
18 cli.expect("OK")
19 cli.sendline("get foo | cat")
20 cli.expect(r"hello")
21 cli.close()