def test_assert_valid_hook_call(self, mock_hook) -> None: task = CloudDataCatalogDeleteTagTemplateOperator( task_id="task_id", location=TEST_LOCATION, tag_template=TEST_TAG_TEMPLATE_ID, force=TEST_FORCE, project_id=TEST_PROJECT_ID, retry=TEST_RETRY, timeout=TEST_TIMEOUT, metadata=TEST_METADATA, gcp_conn_id=TEST_GCP_CONN_ID, impersonation_chain=TEST_IMPERSONATION_CHAIN, ) task.execute(context=mock.MagicMock()) mock_hook.assert_called_once_with( gcp_conn_id=TEST_GCP_CONN_ID, impersonation_chain=TEST_IMPERSONATION_CHAIN, ) mock_hook.return_value.delete_tag_template.assert_called_once_with( location=TEST_LOCATION, tag_template=TEST_TAG_TEMPLATE_ID, force=TEST_FORCE, project_id=TEST_PROJECT_ID, retry=TEST_RETRY, timeout=TEST_TIMEOUT, metadata=TEST_METADATA, )
# [END howto_operator_gcp_datacatalog_delete_tag] # [START howto_operator_gcp_datacatalog_delete_tag_template_field] delete_tag_template_field = CloudDataCatalogDeleteTagTemplateFieldOperator( task_id="delete_tag_template_field", location=LOCATION, tag_template=TEMPLATE_ID, field=FIELD_NAME_2, force=True, ) # [END howto_operator_gcp_datacatalog_delete_tag_template_field] # [START howto_operator_gcp_datacatalog_delete_tag_template] delete_tag_template = CloudDataCatalogDeleteTagTemplateOperator( task_id="delete_tag_template", location=LOCATION, tag_template=TEMPLATE_ID, force=True) # [END howto_operator_gcp_datacatalog_delete_tag_template] # Get # [START howto_operator_gcp_datacatalog_get_entry_group] get_entry_group = CloudDataCatalogGetEntryGroupOperator( task_id="get_entry_group", location=LOCATION, entry_group=ENTRY_GROUP_ID, read_mask={"paths": ["name", "display_name"]}, ) # [END howto_operator_gcp_datacatalog_get_entry_group] # [START howto_operator_gcp_datacatalog_get_entry_group_result]