summaryrefslogtreecommitdiffstats
path: root/tests/unittests/command_parse/test_geo.py
blob: 8a8d4c7b8a93a924ba2b709cca030c967d79bf41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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"',
        },
    )


def test_georadiusbymember(judge_command):
    judge_command(
        "GEORADIUSBYMEMBER Sicily Agrigento 100 km",
        {
            "command": "GEORADIUSBYMEMBER",
            "key": "Sicily",
            "member": "Agrigento",
            "float": "100",
            "distunit": "km",
        },
    )


def test_georadius(judge_command):
    judge_command(
        "GEORADIUS Sicily 15 37 200 km WITHDIST WITHCOORD ",
        {
            "command": "GEORADIUS",
            "key": "Sicily",
            "longitude": "15",
            "latitude": "37",
            "float": "200",
            "distunit": "km",
            "geochoice": "WITHCOORD",
        },
    )