Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search test - Ignore order of the items in the response #2322

Merged
merged 2 commits into from
Aug 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def test_aggregations_groupby(client):

res = client.ft().aggregate(req).rows[0]
assert res[1] == "redis"
assert res[3] == ["RediSearch", "RedisAI", "RedisJson"]
assert set(res[3]) == {"RediSearch", "RedisAI", "RedisJson"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much smarter than what I was thinking. But, I'm not convinced it always works - in older python versions.

Instead can we do an assert on each item in res[3]?


req = aggregations.AggregateRequest("redis").group_by(
"@parent", reducers.first_value("@title").alias("first")
Expand Down