summaryrefslogtreecommitdiffstats
path: root/tests/cli_tests/test_pager.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-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)