From 634177ac441b21a2f905bd06a95be78602777641 Mon Sep 17 00:00:00 2001 From: "J.R. Leeman" Date: Thu, 29 Mar 2018 15:48:28 -0600 Subject: [PATCH] Add to tests for Iowa sounding metadata. --- siphon/tests/test_iastate.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/siphon/tests/test_iastate.py b/siphon/tests/test_iastate.py index c5d038f6a..ca7448d2a 100644 --- a/siphon/tests/test_iastate.py +++ b/siphon/tests/test_iastate.py @@ -19,6 +19,9 @@ def test_iastate(): """Test that we are properly parsing data from the Iowa State archive.""" df = IAStateUpperAir.request_data(datetime(1999, 5, 4, 0), 'OUN') + assert(df['time'][0] == datetime(1999, 5, 4, 0)) + assert(df['station'][0] == 'KOUN') + assert_almost_equal(df['pressure'][6], 872.7, 2) assert_almost_equal(df['height'][6], 1172.0, 2) assert_almost_equal(df['temperature'][6], 18.2, 2) @@ -36,6 +39,8 @@ def test_iastate(): assert(df.units['v_wind'] == 'knot') assert(df.units['speed'] == 'knot') assert(df.units['direction'] == 'degrees') + assert(df.units['station'] is None) + assert(df.units['time'] is None) @recorder.use_cassette('iastate_high_alt_sounding') @@ -43,6 +48,9 @@ def test_high_alt_iastate(): """Test Iowa State data that starts at pressure less than 925 hPa.""" df = IAStateUpperAir.request_data(datetime(2010, 12, 9, 12), 'BOI') + assert(df['time'][0] == datetime(2010, 12, 9, 12)) + assert(df['station'][0] == 'KBOI') + assert_almost_equal(df['pressure'][0], 919.0, 2) assert_almost_equal(df['height'][0], 871.0, 2) assert_almost_equal(df['temperature'][0], -0.1, 2) @@ -51,3 +59,14 @@ def test_high_alt_iastate(): assert_almost_equal(df['v_wind'][0], 1.500, 2) assert_almost_equal(df['speed'][0], 3.0, 1) assert_almost_equal(df['direction'][0], 240.0, 1) + + assert(df.units['pressure'] == 'hPa') + assert(df.units['height'] == 'meter') + assert(df.units['temperature'] == 'degC') + assert(df.units['dewpoint'] == 'degC') + assert(df.units['u_wind'] == 'knot') + assert(df.units['v_wind'] == 'knot') + assert(df.units['speed'] == 'knot') + assert(df.units['direction'] == 'degrees') + assert(df.units['station'] is None) + assert(df.units['time'] is None)