Exemplo n.º 1
0
def test_weatheradapter_Fruitdevis():
    ipm = IPM()
    res = ipm.get_weatheradapter(endpoint='/weatheradapter/davisfruitweb/',
                                 weatherStationId=18150029,
                                 ignoreErrors=True,
                                 timeStart='2021-02-01',
                                 timeEnd='2021-03-01',
                                 parameters=[1001],
                                 credentials={
                                     "username": "******",
                                     "password": "******"
                                 })

    assert type(res) is dict, res
    assert keys_exists(res.keys(),
                       ('timeStart', 'timeEnd', 'interval',
                        'weatherParameters', 'locationWeatherData'))
Exemplo n.º 2
0
def test_get_weatheradapter_fmi():
    ipm = IPM()
    res = ipm.get_weatheradapter(endpoint='/weatheradapter/fmi/',
                                 ignoreErrors=True,
                                 credentials=None,
                                 interval=3600,
                                 parameters=[1002, 3002],
                                 timeStart='2020-06-12T00:00:00+03:00',
                                 timeEnd='2020-07-03T00:00:00+03:00',
                                 weatherStationId=101104)
    assert type(res) is dict
    assert keys_exists(res.keys(),
                       ('timeStart', 'timeEnd', 'interval',
                        'weatherParameters', 'locationWeatherData'))
    assert res['weatherParameters'] == [1002, 3002]
    assert res['timeStart'] == "2020-06-11T21:00:00Z"
    assert res['timeEnd'] == "2020-07-02T21:00:00Z"
    assert res['locationWeatherData'][0]['length'] == 505
Exemplo n.º 3
0
def test_weatheradapter_metos():
    ipm = IPM()
    res = ipm.get_weatheradapter(endpoint='/weatheradapter/metos/',
                                 weatherStationId=732,
                                 ignoreErrors=True,
                                 interval=3600,
                                 timeStart='2020-06-12',
                                 timeEnd='2020-07-03',
                                 parameters=[1001],
                                 credentials={
                                     "username": "******",
                                     "password": "******"
                                 })

    assert type(res) is dict, res
    assert keys_exists(res.keys(),
                       ('timeStart', 'timeEnd', 'interval',
                        'weatherParameters', 'locationWeatherData'))