Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 520F710BA7 for ; Tue, 23 Jul 2013 17:18:55 +0000 (UTC) Received: (qmail 54218 invoked by uid 500); 23 Jul 2013 17:18:55 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 54197 invoked by uid 500); 23 Jul 2013 17:18:54 -0000 Mailing-List: contact commits-help@climate.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.incubator.apache.org Delivered-To: mailing list commits@climate.incubator.apache.org Received: (qmail 54184 invoked by uid 99); 23 Jul 2013 17:18:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 17:18:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 17:18:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 41CE223888E7; Tue, 23 Jul 2013 17:18:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1506166 - /incubator/climate/branches/RefactorInput/ocw/tests/test_evaluation.py Date: Tue, 23 Jul 2013 17:18:33 -0000 To: commits@climate.incubator.apache.org From: joyce@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130723171833.41CE223888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: joyce Date: Tue Jul 23 17:18:32 2013 New Revision: 1506166 URL: http://svn.apache.org/r1506166 Log: CLIMATE-214 - Add add_dataset 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=1506166&r1=1506165&r2=1506166&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:18:32 2013 @@ -47,5 +47,19 @@ class TestEvaluation(unittest.TestCase): self.assertEqual(self.eval.ref_dataset.variable, 'prec') + def test_add_dataset(self): + lat = np.array([10, 12, 14, 16, 18]) + lon = np.array([100, 102, 104, 106, 108]) + time = np.array([dt.datetime(2000, x, 1) for x in range(1, 13)]) + flat_array = np.array(range(300)) + value = flat_array.reshape(12, 5, 5) + variable = 'prec' + test_dataset = Dataset(lat, lon, time, + value, variable) + + self.eval.add_dataset(test_dataset) + + self.assertEqual(self.eval.target_datasets[0].variable, 'prec') + if __name__ == '__main__': unittest.main()