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

Add extra tests for GEO search #3244

Merged
merged 5 commits into from
Jun 12, 2024
Merged

Conversation

gerzse
Copy link
Contributor

@gerzse gerzse commented May 24, 2024

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Add more tests for GEO search, to cover the query operators within, contains, intersects and disjoint, for POINT and POLYGON, i.e. the currently supported shapes and operators.

Add more tests for GEO search, to cover the query operators `within`,
`contains`, `intersects` and `disjoint`, for POINT and POLYGON, i.e. the
currently supported shapes and operators.
@gerzse gerzse requested a review from vladvildanov May 24, 2024 07:18
assert result.total == len(expected_doc_ids)
else:
assert set([doc["id"] for doc in result["results"]]) == set(expected_doc_ids)
assert result["total_results"] == len(expected_doc_ids)
Copy link
Collaborator

Choose a reason for hiding this comment

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

So for RESP2 the response type is an object and for RESP3 array?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly. The object is decoded from the RESP2 style response, which is nested lists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While checking this, I found one existing test that was not asserting well for RESP3, I updated it. Most probably the test does not even run with RESP3, since there were no failures in the past. A thing to check, but I'll leave that for a separate PR.

@gerzse gerzse added the maintenance Maintenance (CI, Releases, etc) label Jun 12, 2024
@gerzse gerzse merged commit 29b861b into redis:master Jun 12, 2024
47 checks passed
gerzse added a commit to gerzse/redis-py that referenced this pull request Jul 11, 2024
Add more tests for GEO search, to cover the query operators `within`,
`contains`, `intersects` and `disjoint`, for POINT and POLYGON, i.e. the
currently supported shapes and operators.
gerzse added a commit that referenced this pull request Jul 11, 2024
Add more tests for GEO search, to cover the query operators `within`,
`contains`, `intersects` and `disjoint`, for POINT and POLYGON, i.e. the
currently supported shapes and operators.
agnesnatasya pushed a commit to agnesnatasya/redis-py that referenced this pull request Jul 20, 2024
Add more tests for GEO search, to cover the query operators `within`,
`contains`, `intersects` and `disjoint`, for POINT and POLYGON, i.e. the
currently supported shapes and operators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance (CI, Releases, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants