File: test_shell_pipeline.py

package info (click to toggle)
iredis 1.15.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,244 kB
  • sloc: python: 7,196; sh: 16; makefile: 14
file content (21 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pexpect


def test_running_disable_shell_pipeline():
    cli = pexpect.spawn("iredis -n 15 --no-shell", timeout=2)
    cli.expect("127.0.0.1")
    cli.sendline("set foo hello")
    cli.expect("OK")
    cli.sendline("get foo | grep w")
    cli.expect(r"hello")
    cli.close()


def test_running_disable_shell_pipeline_with_decode_option():
    cli = pexpect.spawn("iredis -n 15 --decode=utf-8", timeout=2)
    cli.expect("127.0.0.1")
    cli.sendline("set foo hello")
    cli.expect("OK")
    cli.sendline("get foo | cat")
    cli.expect(r"hello")
    cli.close()