From 61a3777eb82896afbb2472017210c7642751ecc2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 Nov 2023 19:52:16 +0100 Subject: Merging upstream version 1.14.0. Signed-off-by: Daniel Baumann --- tests/cli_tests/test_pager.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tests/cli_tests/test_pager.py') 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) -- cgit v1.2.3