diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-04 07:58:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-04 07:58:56 +0000 |
commit | a785d1c2de7d227674051b865935013bdd27e60f (patch) | |
tree | cf642e98373f0a1b8fbc5e772c30c334f2cd4d30 /tests/unittests/command_parse/test_geo.py | |
parent | Adding upstream version 1.11.1. (diff) | |
download | iredis-a785d1c2de7d227674051b865935013bdd27e60f.tar.xz iredis-a785d1c2de7d227674051b865935013bdd27e60f.zip |
Adding upstream version 1.12.0.upstream/1.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/unittests/command_parse/test_geo.py')
-rw-r--r-- | tests/unittests/command_parse/test_geo.py | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/tests/unittests/command_parse/test_geo.py b/tests/unittests/command_parse/test_geo.py index 8a8d4c7..8502696 100644 --- a/tests/unittests/command_parse/test_geo.py +++ b/tests/unittests/command_parse/test_geo.py @@ -9,31 +9,37 @@ def test_geoadd(judge_command): "member": '"Catania"', }, ) + judge_command( + 'GEOADD Sicily NX CH 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"', + { + "command": "GEOADD", + "condition": "NX", + "changed": "CH", + "key": "Sicily", + "longitude": "15.087269", + "latitude": "37.502669", + "member": '"Catania"', + }, + ) -def test_georadiusbymember(judge_command): +def test_geosearch(judge_command): judge_command( - "GEORADIUSBYMEMBER Sicily Agrigento 100 km", + "GEOSEARCH Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST", { - "command": "GEORADIUSBYMEMBER", + "command": "GEOSEARCH", "key": "Sicily", - "member": "Agrigento", - "float": "100", - "distunit": "km", + "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST", }, ) -def test_georadius(judge_command): +def test_geosearchstore(judge_command): judge_command( - "GEORADIUS Sicily 15 37 200 km WITHDIST WITHCOORD ", + "GEOSEARCHSTORE key2 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST", { - "command": "GEORADIUS", - "key": "Sicily", - "longitude": "15", - "latitude": "37", - "float": "200", - "distunit": "km", - "geochoice": "WITHCOORD", + "command": "GEOSEARCHSTORE", + "key": ["Sicily", "key2"], + "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST", }, ) |