You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/12/12 12:03:45 UTC

[GitHub] [airflow] TobKed commented on a change in pull request #6777: [AIRFLOW-6223] BigQuery - improve hook tests [depends on AIRFLOW-6220]

TobKed commented on a change in pull request #6777: [AIRFLOW-6223] BigQuery - improve hook tests [depends on AIRFLOW-6220]
URL: https://github.com/apache/airflow/pull/6777#discussion_r357108310
 
 

 ##########
 File path: tests/gcp/hooks/test_bigquery.py
 ##########
 @@ -693,42 +762,75 @@ def run_with_config(config):
 
 
 class TestDatasetsOperations(unittest.TestCase):
+    @mock.patch(
+        'airflow.gcp.hooks.base.CloudBaseHook._get_credentials_and_project_id',
+        return_value=("CREDENTIALS", "PROJECT_ID",)
+    )
+    @mock.patch("airflow.gcp.hooks.bigquery.BigQueryHook.get_service")
+    def test_create_empty_dataset_no_dataset_id_err(self, mock_get_service, mock_get_creds_and_proj_id):
+        with self.assertRaisesRegex(ValueError, r"{} not provided datasetId\. Impossible to create dataset"):
 
 Review comment:
   I agree it looks weird but the **Exception** message looks exactly like that. I've improved this message and adjusted regex as well. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services