def test_minimal_green_path_for_batch(self, mock_hook): op = CloudVisionImageAnnotateOperator( request=ANNOTATE_REQUEST_BATCH_TEST, task_id='id') op.execute(context=None) mock_hook.assert_called_once_with(gcp_conn_id=GCP_CONN_ID) mock_hook.return_value.batch_annotate_images.assert_called_once_with( requests=ANNOTATE_REQUEST_BATCH_TEST, retry=None, timeout=None)
def test_minimal_green_path_for_one_image(self, mock_hook): op = CloudVisionImageAnnotateOperator(request=ANNOTATE_REQUEST_TEST, task_id='id') op.execute(context=None) mock_hook.assert_called_once_with( gcp_conn_id=GCP_CONN_ID, impersonation_chain=None, ) mock_hook.return_value.annotate_image.assert_called_once_with( request=ANNOTATE_REQUEST_TEST, retry=None, timeout=None )