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

        op = DataprocSubmitHadoopJobOperator(
            task_id=TASK_ID,
            region=GCP_LOCATION,
            gcp_conn_id=GCP_CONN_ID,
            main_jar=self.jar,
            arguments=self.args,
        )
        job = op.generate_job()
        self.assertDictEqual(self.job, job)
Beispiel #2
0
 def test_deprecation_warning(self, mock_hook):
     with self.assertWarns(DeprecationWarning) as warning:
         DataprocSubmitHadoopJobOperator(task_id=TASK_ID,
                                         region=GCP_LOCATION,
                                         main_jar=self.jar,
                                         arguments=self.args)
     assert_warning("DataprocSubmitJobOperator", warning)