Skip to content

Commit

Permalink
add dust_gtc to weather
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Neise committed Oct 4, 2019
1 parent efac6e8 commit 494ab9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions smart_fact_crawler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def weather(url=None, timeout=None, fallback=False):
'wind_gusts': Quantity(s2f(get(table, 8, 1)), 'km/h'),
'wind_direction': get(table, 9, 1),
'dust_tng': Quantity(s2f(get(table, 10, 1)), 'ug/m3'),
'dust_gtc': Quantity(s2f(get(table, 11, 1)), 'ug/m3'),
})


Expand Down
13 changes: 12 additions & 1 deletion smart_fact_crawler/tests/test_functional.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from os import path
import smart_fact_crawler as sfc
from datetime import datetime
from pytest import raises
from pytest import raises, approx

test_dir = '2019_10_03_1531/data'

Expand Down Expand Up @@ -94,3 +94,14 @@ def test_source_name():

assert sfc.current_source().name == 'Park'
assert sfc.drive_tracking().source_name == ''


def test_weather_gtc_dust():
sfc.smartfacturl = 'file:' + path.join(
path.dirname(sfc.__file__),
'resources',
test_dir,
)

weather = sfc.weather()
assert weather.dust_gtc.value == approx(19.2, abs=1e-1)

0 comments on commit 494ab9d

Please sign in to comment.