diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-03-21 10:28:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:16:53 +0000 |
commit | 06cba6ccd165ca8b224797e37fccb9e63f026d77 (patch) | |
tree | e82f1bc439997ae296f2e74f8a64d84c5d95f140 /tests/cli_tests/test_cli_pubsub.py | |
parent | Initial commit. (diff) | |
download | iredis-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_cli_pubsub.py')
-rw-r--r-- | tests/cli_tests/test_cli_pubsub.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/cli_tests/test_cli_pubsub.py b/tests/cli_tests/test_cli_pubsub.py new file mode 100644 index 0000000..956e105 --- /dev/null +++ b/tests/cli_tests/test_cli_pubsub.py @@ -0,0 +1,31 @@ +def test_subscribe(cli, clean_redis): + cli.sendline("subscribe foo") + cli.expect("subscribe from") + cli.expect("foo") + cli.expect("1") + + clean_redis.publish("foo", "test message") + cli.expect("from") + cli.expect("foo") + cli.expect("test message") + + # unsubscribe, send ctrl-c + cli.send(chr(3)) + cli.expect("unsubscribe from") + cli.expect("0") + + +def test_subscribe_in_raw_mode(raw_cli, clean_redis): + raw_cli.sendline("subscribe foo") + raw_cli.expect("subscribe\r") + raw_cli.expect("foo\r") + raw_cli.expect("1\r") + + clean_redis.publish("foo", "test message") + raw_cli.expect("message\r") + raw_cli.expect("foo\r") + raw_cli.expect("test message") + + # unsubscribe, send ctrl-c + raw_cli.send(chr(3)) + raw_cli.expect("0\r") |