import pytest

from vita.data_model.tasks import Location

def address_json_1() -> dict:
    return {
            "address": "成都市成华区",
            "longitude": 104.12,
            "latitude": 30.65
        }

def address_json_2() -> dict:
    return {
            "address": "北京市",
            "longitude": 104.12,
            "latitude": 30.65
        }


def address_1(address_json_1: dict) -> Location:
    return Location.from_json(address_json_1)

def address_2(address_json_2: dict) -> Location:
    return Location.from_json(address_json_2)


def test_address():
    address_1(address_json_1())
    address_2(address_json_2())
    print(Location.get_all())


