climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omk...@apache.org
Subject [1/2] climate git commit: CLIMATE-775 - Fix failing tests in ocw_config_runner
Date Sat, 02 Apr 2016 18:11:11 GMT
Repository: climate
Updated Branches:
  refs/heads/master 4b90aced8 -> 584ee861d


CLIMATE-775 - Fix failing tests in ocw_config_runner


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/14479781
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/14479781
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/14479781

Branch: refs/heads/master
Commit: 14479781f56057c722df08626edb65adb0790b72
Parents: 37dd5a8
Author: Ibrahim <jarifibrahim@gmail.com>
Authored: Mon Mar 28 22:54:04 2016 +0530
Committer: Ibrahim <jarifibrahim@gmail.com>
Committed: Mon Mar 28 22:54:04 2016 +0530

----------------------------------------------------------------------
 ocw_config_runner/tests/test_config_parsing.py  | 46 ++++++++++----------
 ocw_config_runner/tests/test_config_writer.py   |  2 +-
 .../tests/test_evaluation_creation.py           |  4 +-
 3 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/14479781/ocw_config_runner/tests/test_config_parsing.py
----------------------------------------------------------------------
diff --git a/ocw_config_runner/tests/test_config_parsing.py b/ocw_config_runner/tests/test_config_parsing.py
index e918405..d2facf4 100644
--- a/ocw_config_runner/tests/test_config_parsing.py
+++ b/ocw_config_runner/tests/test_config_parsing.py
@@ -18,7 +18,7 @@
 from mock import patch
 import unittest
 
-import configuration_parsing as parser
+import ocw_config_runner.configuration_parsing as parser
 import ocw.metrics as metrics
 
 import yaml
@@ -60,7 +60,7 @@ class TestIsConfigValid(unittest.TestCase):
         """
         self.not_well_formed = yaml.load(not_well_formed_config)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_not_minimal_config(self, mock_logger):
         ret = parser.is_config_valid(self.not_minimal)
         self.assertFalse(ret)
@@ -69,7 +69,7 @@ class TestIsConfigValid(unittest.TestCase):
             'Insufficient configuration file data for an evaluation'
         )
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_not_valid_config(self, mock_logger):
         ret = parser.is_config_valid(self.not_well_formed)
         self.assertFalse(ret)
@@ -172,7 +172,7 @@ class TestValidMinimalConfig(unittest.TestCase):
         """
         self.binary_no_target = yaml.load(binary_no_target_config)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_no_datasets(self, mock_logger):
         ret = parser._valid_minimal_config(self.no_datasets)
         self.assertFalse(ret)
@@ -181,7 +181,7 @@ class TestValidMinimalConfig(unittest.TestCase):
             'No datasets specified in configuration data.'
         )
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_no_metrics(self, mock_logger):
         ret = parser._valid_minimal_config(self.no_metrics)
         self.assertFalse(ret)
@@ -198,7 +198,7 @@ class TestValidMinimalConfig(unittest.TestCase):
         ret = parser._valid_minimal_config(self.unary_with_target)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_unary_no_datasets(self, mock_logger):
         ret = parser._valid_minimal_config(self.unary_no_ref_or_target)
         self.assertFalse(ret)
@@ -213,7 +213,7 @@ class TestValidMinimalConfig(unittest.TestCase):
         ret = parser._valid_minimal_config(self.binary_valid)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_binary_no_reference(self, mock_logger):
         ret = parser._valid_minimal_config(self.binary_no_reference)
         self.assertFalse(ret)
@@ -224,7 +224,7 @@ class TestValidMinimalConfig(unittest.TestCase):
             'that your config is well formed.'
         )
         
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_binary_no_target(self, mock_logger):
         ret = parser._valid_minimal_config(self.binary_no_target)
         self.assertFalse(ret)
@@ -324,7 +324,7 @@ class TestConfigIsWellFormed(unittest.TestCase):
         ret = parser._config_is_well_formed(self.malformed_reference_conf)
         self.assertFalse(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_malformed_target_dataset_list(self, mock_logger):
         ret = parser._config_is_well_formed(self.malformed_target_list)
         self.assertFalse(ret)
@@ -338,7 +338,7 @@ class TestConfigIsWellFormed(unittest.TestCase):
         ret = parser._config_is_well_formed(self.missing_metric_name)
         self.assertFalse(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_warns_regarding_not_builtin_metric(self, mock_logger):
         ret = parser._config_is_well_formed(self.missing_metric_name)
         mock_logger.warn.assert_called_with(
@@ -406,14 +406,14 @@ class InvalidDatasetConfig(unittest.TestCase):
         self.missing_data_source = conf[0]
         self.invalid_data_source = conf[1]
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_missing_data_source_config(self, mock_logger):
         parser._valid_dataset_config_data(self.missing_data_source)
         mock_logger.error.assert_called_with(
             'Dataset does not contain a data_source attribute.'
         )
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_data_source(self, mock_logger):
         parser._valid_dataset_config_data(self.invalid_data_source)
         mock_logger.error.assert_called_with(
@@ -464,7 +464,7 @@ class TestLocalDatasetConfig(unittest.TestCase):
         ret = parser._valid_dataset_config_data(self.valid_local_multi)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_local_config(self, mock_logger):
         parser._valid_dataset_config_data(self.invalid_local_single)
 
@@ -478,7 +478,7 @@ class TestLocalDatasetConfig(unittest.TestCase):
         )
         mock_logger.error.assert_called_with(error)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_local_config_multi_file(self, mock_logger):
         # mutlifile config is handled slightly differently. We should see the
         # same missing keys in this situation as we would on the single file
@@ -496,7 +496,7 @@ class TestLocalDatasetConfig(unittest.TestCase):
         )
         mock_logger.error.assert_called_with(error)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_local_config_multi_file_missing_file_glob(self, mock_logger):
         # We can't check for the file_glob_pattern pattern until after we have
         # verified that the single local file config has been met.
@@ -541,7 +541,7 @@ class TestRCMEDDatasetConfig(unittest.TestCase):
         ret = parser._valid_dataset_config_data(self.valid_rcmed)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_rcmed_config(self, mock_logger):
         parser._valid_dataset_config_data(self.invalid_rcmed)
 
@@ -583,7 +583,7 @@ class TestESGFDatasetConfig(unittest.TestCase):
         ret = parser._valid_dataset_config_data(self.valid_esgf)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_esgf_conf(self, mock_logger):
         parser._valid_dataset_config_data(self.invalid_esgf)
 
@@ -617,7 +617,7 @@ class TestDAPDatasetConfig(unittest.TestCase):
         ret = parser._valid_dataset_config_data(self.valid_dap)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_dap_config(self, mock_logger):
         parser._valid_dataset_config_data(self.invalid_dap)
 
@@ -667,7 +667,7 @@ class ContourMapConfig(unittest.TestCase):
         ret = parser._valid_plot_config_data(self.valid_contour)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_missing_keys_contour(self, mock_logger):
         ret = parser._valid_plot_config_data(self.missing_keys_contour)
 
@@ -714,7 +714,7 @@ class TestSubregionPlotConfig(unittest.TestCase):
         ret = parser._valid_plot_config_data(self.valid_subregion)
         self.assertTrue(ret)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_missing_keys_subregion(self, mock_logger):
         ret = parser._valid_plot_config_data(self.missing_keys_subregion)
 
@@ -775,7 +775,7 @@ class TestInvalidPlotConfig(unittest.TestCase):
         """
         self.missing_subregions = yaml.load(missing_subregions_for_plot_type)
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_invalid_plot_type(self, mock_logger):
         ret = parser._valid_plot_config_data(self.bad_plot_type)
         self.assertFalse(ret)
@@ -784,7 +784,7 @@ class TestInvalidPlotConfig(unittest.TestCase):
             'Invalid plot type specified.'
         )
 
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_missing_plot_type(self, mock_logger):
         ret = parser._valid_plot_config_data(self.missing_plot_type)
         self.assertFalse(ret)
@@ -793,7 +793,7 @@ class TestInvalidPlotConfig(unittest.TestCase):
             'Plot config does not include a type attribute.'
         )
         
-    @patch('configuration_parsing.logger')
+    @patch('ocw_config_runner.configuration_parsing.logger')
     def test_missing_subregion(self, mock_logger):
         ret = parser._config_is_well_formed(self.missing_subregions)
         self.assertFalse(ret)

http://git-wip-us.apache.org/repos/asf/climate/blob/14479781/ocw_config_runner/tests/test_config_writer.py
----------------------------------------------------------------------
diff --git a/ocw_config_runner/tests/test_config_writer.py b/ocw_config_runner/tests/test_config_writer.py
index f163989..c961447 100644
--- a/ocw_config_runner/tests/test_config_writer.py
+++ b/ocw_config_runner/tests/test_config_writer.py
@@ -22,7 +22,7 @@ import unittest
 from ocw.dataset import Dataset, Bounds
 from ocw.evaluation import Evaluation
 import ocw.metrics as metrics
-import configuration_writer as writer
+import ocw_config_runner.configuration_writer as writer
 
 import datetime as dt
 import numpy as np

http://git-wip-us.apache.org/repos/asf/climate/blob/14479781/ocw_config_runner/tests/test_evaluation_creation.py
----------------------------------------------------------------------
diff --git a/ocw_config_runner/tests/test_evaluation_creation.py b/ocw_config_runner/tests/test_evaluation_creation.py
index 41f998e..b8ed404 100644
--- a/ocw_config_runner/tests/test_evaluation_creation.py
+++ b/ocw_config_runner/tests/test_evaluation_creation.py
@@ -18,7 +18,7 @@
 from mock import patch
 import unittest
 
-import evaluation_creation as eval_create
+import ocw_config_runner.evaluation_creation as eval_create
 import ocw.metrics
 
 import yaml
@@ -33,7 +33,7 @@ class TestMetricLoad(unittest.TestCase):
                           for m in config['metrics']]
         self.assertTrue(isinstance(loaded_metrics[0], ocw.metrics.Bias))
 
-    @patch('evaluation_creation.logger')
+    @patch('ocw_config_runner.evaluation_creation.logger')
     def test_invalid_metric_load(self, mock_logger):
         config = yaml.load("""
             metrics:


Mime
View raw message