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/08/28 10:40:41 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #5928: [AIRFLOW-5168] Fix Dataproc Operators & add tests

nuclearpinguin commented on a change in pull request #5928: [AIRFLOW-5168] Fix Dataproc Operators & add tests
URL: https://github.com/apache/airflow/pull/5928#discussion_r318511335
 
 

 ##########
 File path: tests/contrib/operators/test_dataproc_operator.py
 ##########
 @@ -541,18 +592,56 @@ def test_delete_cluster(self):
                 requestId=mock.ANY)
             hook.wait.assert_called_once_with(self.operation)
 
+    def test_render_template(self):
+        task = DataprocClusterDeleteOperator(
+            task_id=TASK_ID,
+            cluster_name=CLUSTER_NAME_TEMPLATED,
+            project_id=GCP_PROJECT_TEMPLATED,
+            region=GCP_REGION_TEMPLATED,
+            dag=self.dag,
+        )
+
+        self.assertEqual(task.template_fields,
+                         ['cluster_name', 'project_id', 'region'])
 
 Review comment:
   I think it would be better to test if elements of `template_fields` are attributes of instance. Then changing attribute name without changing template field would result in test failure. WDYT?

----------------------------------------------------------------
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