Debian Codegraph @

tests/unittests/command_parse/test_geo.py

raw
1 def test_geoadd(judge_command):
2 judge_command(
3 'GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"',
4 {
5 "command": "GEOADD",
6 "key": "Sicily",
7 "longitude": "15.087269",
8 "latitude": "37.502669",
9 "member": '"Catania"',
10 },
11 )
12 judge_command(
13 'GEOADD Sicily NX CH 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"',
14 {
15 "command": "GEOADD",
16 "condition": "NX",
17 "changed": "CH",
18 "key": "Sicily",
19 "longitude": "15.087269",
20 "latitude": "37.502669",
21 "member": '"Catania"',
22 },
23 )
24
25
26 def test_geosearch(judge_command):
27 judge_command(
28 "GEOSEARCH Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST",
29 {
30 "command": "GEOSEARCH",
31 "key": "Sicily",
32 "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST",
33 },
34 )
35
36
37 def test_geosearchstore(judge_command):
38 judge_command(
39 "GEOSEARCHSTORE key2 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST",
40 {
41 "command": "GEOSEARCHSTORE",
42 "key": ["Sicily", "key2"],
43 "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST",
44 },
45 )