You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/08/12 18:43:59 UTC
svn commit: r1513192 -
/incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py
Author: joyce
Date: Mon Aug 12 16:43:59 2013
New Revision: 1513192
URL: http://svn.apache.org/r1513192
Log:
CLIMATE-214 - Add a unit test for a proper Evaluation init
Modified:
incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py
Modified: incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py
URL: http://svn.apache.org/viewvc/incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py?rev=1513192&r1=1513191&r2=1513192&view=diff
==============================================================================
--- incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py (original)
+++ incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py Mon Aug 12 16:43:59 2013
@@ -45,6 +45,24 @@ class TestEvaluation(unittest.TestCase):
self.assertEquals(self.eval.metrics, [])
self.assertEquals(self.eval.unary_metrics, [])
+ def test_full_init(self):
+ self.eval = Evaluation(
+ self.test_dataset,
+ [self.test_dataset, self.another_test_dataset],
+ [Bias(), Bias(), TemporalStdDev()])
+
+ self.assertEqual(self.eval.ref_dataset.variable, self.variable)
+
+ # Make sure the two target datasets were added properly
+ self.assertEqual(self.eval.target_datasets[0].variable, self.variable)
+ self.assertEqual(self.eval.target_datasets[1].variable, self.other_var)
+
+ # Make sure the three metrics were added properly
+ # The two Bias metrics are "binary" metrics
+ self.assertEqual(len(self.eval.metrics), 2)
+ # TemporalStdDev is a "unary" metric and should be stored as such
+ self.assertEqual(len(self.eval.unary_metrics), 1)
+
def test_add_ref_dataset(self):
self.eval = Evaluation(self.test_dataset, [], [])