Skip to content

Commit e3f8479

Browse files
authored
Merge pull request #76 from benjwadams/fix_station_counts_tests
Update NDBC station counts to fix tests
2 parents dc281f1 + bafd1d1 commit e3f8479

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

tests/collectors/test_ndbc_sos.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def test_raw_ndbc_get_observation_all_stations(self):
6262

6363
data = list(csv.DictReader(io.StringIO(response)))
6464
stations = list(set([x['station_id'] for x in data]))
65-
# 265 stations measured air_pressure that day
66-
assert len(stations) == 265
65+
# 264 stations measured air_pressure that day
66+
assert len(stations) == 264
6767

6868
"""
6969
station_id,sensor_id,"latitude (degree)","longitude (degree)",date_time,"depth (m)","air_pressure_at_sea_level (hPa)"
@@ -86,8 +86,8 @@ def test_raw_ndbc_get_observation_no_stations(self):
8686

8787
data = list(csv.DictReader(io.StringIO(response)))
8888
stations = list(set([x['station_id'] for x in data]))
89-
# 265 stations measured air_pressure that day
90-
assert len(stations) == 265
89+
# 264 stations measured air_pressure that day
90+
assert len(stations) == 264
9191

9292
"""
9393
station_id,sensor_id,"latitude (degree)","longitude (degree)",date_time,"depth (m)","air_pressure_at_sea_level (hPa)"

tests/parsers/test_ioos_get_observation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def test_o_and_m_get_observation(self):
4747
assert ts.location["urn:ioos:station:wmo:41002"].equals(Point(-75.415, 32.382))
4848

4949
def test_timeseries_multi_station_multi_sensor(self):
50-
swe = open(resource_file('ioos_swe/SWE-MultiStation-TimeSeries.xml'), 'rb').read()
50+
swe = open(resource_file('ioos_swe/SWE-MultiStation-TimeSeries.xml'),
51+
'rb').read()
5152
data_record = etree.fromstring(swe)
5253
collection = TimeSeries(data_record).feature
5354

@@ -67,7 +68,10 @@ def test_timeseries_single_station_single_sensor(self):
6768
assert station.location.y == 32.382
6869
assert station.location.z == 0.5
6970

70-
assert sorted([x.time.strftime("%Y-%m-%dT%H:%M:%SZ") for x in station.elements]) == sorted(["2009-05-23T00:00:00Z", "2009-05-23T01:00:00Z", "2009-05-23T02:00:00Z"])
71+
assert sorted([x.time.strftime("%Y-%m-%dT%H:%M:%SZ") for x in
72+
station.elements]) == sorted(["2009-05-23T00:00:00Z",
73+
"2009-05-23T01:00:00Z",
74+
"2009-05-23T02:00:00Z"])
7175

7276
first_members = station.elements[0].members
7377
assert sorted([x['value'] for x in first_members]) == sorted([2.0, 15.4, 280])

0 commit comments

Comments
 (0)