def test_invalid_cmd_type(self):
     """
     Tests to verify if the cmd_type is not import or export, an exception is raised.
     """
     operator = SqoopOperator(task_id='sqoop_job', dag=self.dag,
                              cmd_type='invalid')
     with self.assertRaises(AirflowException):
         operator.execute({})
 def test_invalid_cmd_type(self):
     """
     Tests to verify if the cmd_type is not import or export, an exception is raised.
     """
     operator = SqoopOperator(task_id='sqoop_job', dag=self.dag,
                              cmd_type='invalid')
     with self.assertRaises(AirflowException):
         operator.execute({})
 def test_invalid_import_options(self):
     """
     Tests to verify if a user passes both a query and a table then an exception is raised.
     """
     import_query_and_table_configs = self._config.copy()
     import_query_and_table_configs['cmd_type'] = 'import'
     operator = SqoopOperator(task_id='sqoop_job',
                              dag=self.dag,
                              **import_query_and_table_configs)
     with self.assertRaises(AirflowException):
         operator.execute({})
 def test_invalid_import_options(self):
     """
     Tests to verify if a user passes both a query and a table then an exception is raised.
     """
     import_query_and_table_configs = self._config.copy()
     import_query_and_table_configs['cmd_type'] = 'import'
     operator = SqoopOperator(
         task_id='sqoop_job',
         dag=self.dag,
         **import_query_and_table_configs
     )
     with self.assertRaises(AirflowException):
         operator.execute({})
 def test_invalid_cmd_type(self):
     operator = SqoopOperator(task_id='sqoop_job', dag=self.dag,
                              cmd_type='invalid')
     with self.assertRaises(AirflowException):
         operator.execute({})
 def test_invalid_cmd_type(self):
     operator = SqoopOperator(task_id='sqoop_job',
                              dag=self.dag,
                              cmd_type='invalid')
     with self.assertRaises(AirflowException):
         operator.execute({})