diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:38:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:38:04 +0000 |
commit | e0847dd62461001851da4c89f279e16b14c3eb4c (patch) | |
tree | 87422376dd9a7eee55850f0fce9a8bb4c13e44a2 /tests/unittests/command_parse/test_geo.py | |
parent | Initial commit. (diff) | |
download | iredis-e0847dd62461001851da4c89f279e16b14c3eb4c.tar.xz iredis-e0847dd62461001851da4c89f279e16b14c3eb4c.zip |
Adding upstream version 1.13.0.upstream/1.13.0upstream
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 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/unittests/command_parse/test_geo.py b/tests/unittests/command_parse/test_geo.py new file mode 100644 index 0000000..8502696 --- /dev/null +++ b/tests/unittests/command_parse/test_geo.py @@ -0,0 +1,45 @@ +def test_geoadd(judge_command): + judge_command( + 'GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"', + { + "command": "GEOADD", + "key": "Sicily", + "longitude": "15.087269", + "latitude": "37.502669", + "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_geosearch(judge_command): + judge_command( + "GEOSEARCH Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST", + { + "command": "GEOSEARCH", + "key": "Sicily", + "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST", + }, + ) + + +def test_geosearchstore(judge_command): + judge_command( + "GEOSEARCHSTORE key2 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST", + { + "command": "GEOSEARCHSTORE", + "key": ["Sicily", "key2"], + "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST", + }, + ) |