Ejemplo n.º 1
0
    def test_history():
        api_key = os.environ['APIXUKEY']
        client = ApixuClient(api_key)

        now = datetime.datetime.now()
        history = client.history(
            q='London',
            since=datetime.date(now.year, now.month, now.day),
            until=datetime.date(now.year, now.month, now.day),
        )
        validate(history, schema.read("history.json"))
Ejemplo n.º 2
0
    def test_conditions():
        client = ApixuClient()

        conditions = client.conditions()
        validate(conditions, schema.read("conditions.json"))
Ejemplo n.º 3
0
    def test_search():
        api_key = os.environ['APIXUKEY']
        client = ApixuClient(api_key)

        history = client.search(q='London')
        validate(history, schema.read("search.json"))
Ejemplo n.º 4
0
    def test_forecast():
        api_key = os.environ['APIXUKEY']
        client = ApixuClient(api_key)

        forecast = client.forecast('London', 1, 12)
        validate(forecast, schema.read("forecast.json"))
Ejemplo n.º 5
0
    def test_current():
        api_key = os.environ['APIXUKEY']
        client = ApixuClient(api_key)

        current = client.current('London')
        validate(current, schema.read('current.json'))