Exemple #1
0
    def test_execute(self, mock_hook, mock_uuid):
        mock_hook.return_value.project_id = GCP_PROJECT
        mock_uuid.return_value = self.job_id

        op = DataprocSubmitPySparkJobOperator(
            task_id=TASK_ID, region=GCP_LOCATION, gcp_conn_id=GCP_CONN_ID, main=self.uri
        )
        job = op.generate_job()
        self.assertDictEqual(self.job, job)
Exemple #2
0
 def test_deprecation_warning(self, mock_hook):
     with self.assertWarns(DeprecationWarning) as warning:
         DataprocSubmitPySparkJobOperator(
             task_id=TASK_ID,
             region=GCP_LOCATION,
             main=self.uri,
         )
     assert_warning("DataprocSubmitJobOperator", warning)