Ejemplo n.º 1
0
    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.
        parser._valid_dataset_config_data(self.invalid_local_multi_file_glob)

        mock_logger.error.assert_called_with(
            'Multi-file local dataset is missing key: file_glob_pattern')
Ejemplo n.º 2
0
    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.
        parser._valid_dataset_config_data(self.invalid_local_multi_file_glob)

        mock_logger.error.assert_called_with(
            'Multi-file local dataset is missing key: file_glob_pattern'
        )
Ejemplo n.º 3
0
    def test_invalid_dap_config(self, mock_logger):
        parser._valid_dataset_config_data(self.invalid_dap)

        present_keys = set(self.invalid_dap.keys())
        missing_keys = self.required_dap_keys - present_keys
        missing = sorted(list(missing_keys))

        error = ('Dataset does not contain required keys. '
                 'The following keys are missing: {}'.format(
                     ', '.join(missing)))
        mock_logger.error.assert_called_with(error)
Ejemplo n.º 4
0
    def test_invalid_dap_config(self, mock_logger):
        parser._valid_dataset_config_data(self.invalid_dap)

        present_keys = set(self.invalid_dap.keys())
        missing_keys = self.required_dap_keys - present_keys
        missing = sorted(list(missing_keys))

        error = (
            'Dataset does not contain required keys. '
            'The following keys are missing: {}'.format(', '.join(missing))
        )
        mock_logger.error.assert_called_with(error)
Ejemplo n.º 5
0
    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
        # local config. We will test for a missing file_glob_pattern in a
        # different test.
        parser._valid_dataset_config_data(self.invalid_local_multi)

        present_keys = set(self.invalid_local_multi.keys())
        missing_keys = self.required_local_keys - present_keys
        missing = sorted(list(missing_keys))

        error = ('Dataset does not contain required keys. '
                 'The following keys are missing: {}'.format(
                     ', '.join(missing)))
        mock_logger.error.assert_called_with(error)
Ejemplo n.º 6
0
    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
        # local config. We will test for a missing file_glob_pattern in a
        # different test.
        parser._valid_dataset_config_data(self.invalid_local_multi)

        present_keys = set(self.invalid_local_multi.keys())
        missing_keys = self.required_local_keys - present_keys
        missing = sorted(list(missing_keys))

        error = (
            'Dataset does not contain required keys. '
            'The following keys are missing: {}'.format(', '.join(missing))
        )
        mock_logger.error.assert_called_with(error)
Ejemplo n.º 7
0
 def test_valid_esgf_conf(self):
     ret = parser._valid_dataset_config_data(self.valid_esgf)
     self.assertTrue(ret)
Ejemplo n.º 8
0
 def test_valid_local_config_multi_file(self):
     ret = parser._valid_dataset_config_data(self.valid_local_multi)
     self.assertTrue(ret)
Ejemplo n.º 9
0
 def test_valid_local_config_single_file(self):
     ret = parser._valid_dataset_config_data(self.valid_local_single)
     self.assertTrue(ret)
Ejemplo n.º 10
0
 def test_invalid_data_source(self, mock_logger):
     parser._valid_dataset_config_data(self.invalid_data_source)
     mock_logger.error.assert_called_with(
         'Dataset does not contain a valid data_source location.'
     )
Ejemplo n.º 11
0
 def test_invalid_data_source(self, mock_logger):
     parser._valid_dataset_config_data(self.invalid_data_source)
     mock_logger.error.assert_called_with(
         'Dataset does not contain a valid data_source location.')
Ejemplo n.º 12
0
 def test_valid_dap_config(self):
     ret = parser._valid_dataset_config_data(self.valid_dap)
     self.assertTrue(ret)
Ejemplo n.º 13
0
 def test_valid_esgf_conf(self):
     ret = parser._valid_dataset_config_data(self.valid_esgf)
     self.assertTrue(ret)
Ejemplo n.º 14
0
 def test_valid_local_config_multi_file(self):
     ret = parser._valid_dataset_config_data(self.valid_local_multi)
     self.assertTrue(ret)
Ejemplo n.º 15
0
 def test_valid_local_config_single_file(self):
     ret = parser._valid_dataset_config_data(self.valid_local_single)
     self.assertTrue(ret)
Ejemplo n.º 16
0
 def test_valid_dap_config(self):
     ret = parser._valid_dataset_config_data(self.valid_dap)
     self.assertTrue(ret)
Ejemplo n.º 17
0
 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.'
     )
Ejemplo n.º 18
0
 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.')