Skip to content

Commit 1c2461d

Browse files
sobolevndvora-h
andauthored
Test test_get_moveable_keys was broken (#2411)
* Test `test_get_moveable_keys` was broken * Update test_command_parser.py * Do not sort constant lists Co-authored-by: dvora-h <[email protected]>
1 parent 0f2cc69 commit 1c2461d

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

tests/test_command_parser.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,13 @@ def test_get_moveable_keys(self, r):
5151
]
5252
args7 = ["MIGRATE", "192.168.1.34", 6379, "key1", 0, 5000]
5353

54-
assert commands_parser.get_keys(r, *args1).sort() == ["key1", "key2"].sort()
55-
assert (
56-
commands_parser.get_keys(r, *args2).sort() == ["mystream", "writers"].sort()
57-
)
58-
assert (
59-
commands_parser.get_keys(r, *args3).sort()
60-
== ["out", "zset1", "zset2"].sort()
61-
)
62-
assert commands_parser.get_keys(r, *args4).sort() == ["Sicily", "out"].sort()
63-
assert commands_parser.get_keys(r, *args5).sort() == ["foo"].sort()
64-
assert (
65-
commands_parser.get_keys(r, *args6).sort()
66-
== ["key1", "key2", "key3"].sort()
67-
)
68-
assert commands_parser.get_keys(r, *args7).sort() == ["key1"].sort()
54+
assert sorted(commands_parser.get_keys(r, *args1)) == ["key1", "key2"]
55+
assert sorted(commands_parser.get_keys(r, *args2)) == ["mystream", "writers"]
56+
assert sorted(commands_parser.get_keys(r, *args3)) == ["out", "zset1", "zset2"]
57+
assert sorted(commands_parser.get_keys(r, *args4)) == ["Sicily", "out"]
58+
assert sorted(commands_parser.get_keys(r, *args5)) == ["foo"]
59+
assert sorted(commands_parser.get_keys(r, *args6)) == ["key1", "key2", "key3"]
60+
assert sorted(commands_parser.get_keys(r, *args7)) == ["key1"]
6961

7062
# A bug in redis<7.0 causes this to fail: https://github.com/redis/redis/issues/9493
7163
@skip_if_server_version_lt("7.0.0")

0 commit comments

Comments
 (0)