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"))
def test_conditions(): client = ApixuClient() conditions = client.conditions() validate(conditions, schema.read("conditions.json"))
def test_search(): api_key = os.environ['APIXUKEY'] client = ApixuClient(api_key) history = client.search(q='London') validate(history, schema.read("search.json"))
def test_forecast(): api_key = os.environ['APIXUKEY'] client = ApixuClient(api_key) forecast = client.forecast('London', 1, 12) validate(forecast, schema.read("forecast.json"))
def test_current(): api_key = os.environ['APIXUKEY'] client = ApixuClient(api_key) current = client.current('London') validate(current, schema.read('current.json'))