summaryrefslogtreecommitdiffstats
path: root/tests/unittests/command_parse/test_geo.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/command_parse/test_geo.py')
-rw-r--r--tests/unittests/command_parse/test_geo.py36
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",
},
)