def test_metadata(self): """Test that the metadata is set as expected """ plugin = WindGustDiagnostic(50.0, 80.0) result = plugin.add_metadata(self.cube_wg) self.assertEqual(result.standard_name, "wind_speed_of_gust") self.assertEqual(result.long_name, "wind_gust_diagnostic") msg = ('<WindGustDiagnostic: wind-gust perc=50.0, ' 'wind-speed perc=80.0>') self.assertEqual(result.attributes['wind_gust_diagnostic'], msg)
def test_diagnostic_extreme_txt(self): """Test that the attribute is set as expected for extreme gusts""" plugin = WindGustDiagnostic(95.0, 100.0) result = plugin.add_metadata(self.cube_wg) msg = 'Extreme gusts' self.assertEqual(result.attributes['wind_gust_diagnostic'], msg)
def test_diagnostic_typical_txt(self): """Test that the attribute is set as expected for typical gusts""" plugin = WindGustDiagnostic(50.0, 95.0) result = plugin.add_metadata(self.cube_wg) msg = 'Typical gusts' self.assertEqual(result.attributes['wind_gust_diagnostic'], msg)
def test_basic(self): """Test that the function returns a Cube. """ plugin = WindGustDiagnostic(50.0, 95.0) result = plugin.add_metadata(self.cube_wg) self.assertIsInstance(result, Cube)