summaryrefslogtreecommitdiffstats
path: root/tests/cli_tests/test_pager.py
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2023-11-04 18:52:16 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2023-11-04 18:52:16 +0000
commit61a3777eb82896afbb2472017210c7642751ecc2 (patch)
treefbd20f88f28005e6083560ba65e0194403aa3e42 /tests/cli_tests/test_pager.py
parentReleasing debian version 1.13.1-1. (diff)
downloadiredis-61a3777eb82896afbb2472017210c7642751ecc2.tar.xz
iredis-61a3777eb82896afbb2472017210c7642751ecc2.zip
Merging upstream version 1.14.0.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'tests/cli_tests/test_pager.py')
-rw-r--r--tests/cli_tests/test_pager.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/cli_tests/test_pager.py b/tests/cli_tests/test_pager.py
index 38ced31..c3f9fb0 100644
--- a/tests/cli_tests/test_pager.py
+++ b/tests/cli_tests/test_pager.py
@@ -1,10 +1,12 @@
# noqa: F541
+from contextlib import contextmanager
import os
-import sys
-import pexpect
import pathlib
-from contextlib import contextmanager
+import sys
from textwrap import dedent
+from packaging.version import parse as version_parse
+
+import pexpect
TEST_IREDISRC = "/tmp/.iredisrc.test"
@@ -22,6 +24,10 @@ env_pager_numbers = "{0} {1} {2}".format(
TEST_PAGER_BOUNDARY_NUMBER,
)
+long_list_type = "quicklist"
+if version_parse(os.environ["REDIS_VERSION"]) >= version_parse("7"):
+ long_list_type = "listpack"
+
@contextmanager
def pager_enabled_cli():
@@ -60,7 +66,7 @@ def test_pager_works_for_peek(clean_redis):
with pager_enabled_cli() as child:
child.sendline("peek long-list")
child.expect(TEST_PAGER_BOUNDARY)
- child.expect("(quicklist)")
+ child.expect(f"({long_list_type})")
child.expect("value-1")
child.expect(TEST_PAGER_BOUNDARY)