climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1506185 - /incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py
Date Tue, 23 Jul 2013 17:48:38 GMT
Author: joyce
Date: Tue Jul 23 17:48:38 2013
New Revision: 1506185

URL: http://svn.apache.org/r1506185
Log:
CLIMATE-214 - Add add_metrics test for Evaluation

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=1506185&r1=1506184&r2=1506185&view=diff
==============================================================================
--- incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py (original)
+++ incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py Tue Jul 23 17:48:38
2013
@@ -82,6 +82,15 @@ class TestEvaluation(unittest.TestCase):
 
         self.assertEqual(self.eval.metrics[0](2), 3)
 
+    def test_add_metrics(self):
+        test_func = lambda x: x + 1
+        another_test_func = lambda x: x * 5
+        self.eval.add_metrics([test_func, another_test_func])
+
+        self.assertEqual(self.eval.metrics[0](2), 3)
+        self.assertEqual(self.eval.metrics[1](2), 10)
+        
+
 
 if __name__  == '__main__':
     unittest.main()



Mime
View raw message