Skip to content

Commit

Permalink
change body to be realistic
Browse files Browse the repository at this point in the history
  • Loading branch information
romsharon98 committed Feb 4, 2024
1 parent c6e9868 commit 2896623
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
SCHEDULE: SCHEDULE_DICT,
TRANSFER_SPEC: {GCS_DATA_SINK: {BUCKET_NAME: GCS_BUCKET_NAME, PATH: DESTINATION_PATH}},
}
VALID_TRANSFER_JOB_JINJA = deepcopy(VALID_TRANSFER_JOB_BASE)
VALID_TRANSFER_JOB_JINJA[NAME] = "{{ dag.dag_id }}"
VALID_TRANSFER_JOB_JINJA_RENDERED = deepcopy(VALID_TRANSFER_JOB_JINJA)
VALID_TRANSFER_JOB_JINJA_RENDERED[NAME] = "TestGcpStorageTransferJobCreateOperator"
VALID_TRANSFER_JOB_GCS = deepcopy(VALID_TRANSFER_JOB_BASE)
VALID_TRANSFER_JOB_GCS[TRANSFER_SPEC].update(deepcopy(SOURCE_GCS))
VALID_TRANSFER_JOB_AWS = deepcopy(VALID_TRANSFER_JOB_BASE)
Expand Down Expand Up @@ -326,21 +330,13 @@ def test_job_create_multiple(self, aws_hook, gcp_hook):
@pytest.mark.db_test
@pytest.mark.parametrize(
"body, excepted",
[
(
{"description": "{{ dag.dag_id }}"},
{
"description": "TestGcpStorageTransferJobCreateOperator_test_templates",
},
),
("{{ dag.dag_id }}", "TestGcpStorageTransferJobCreateOperator_test_templates"),
],
[(VALID_TRANSFER_JOB_JINJA, VALID_TRANSFER_JOB_JINJA_RENDERED)],
)
@mock.patch(
"airflow.providers.google.cloud.operators.cloud_storage_transfer_service.CloudDataTransferServiceHook"
)
def test_templates(self, _, create_task_instance_of_operator, body, excepted):
dag_id = "TestGcpStorageTransferJobCreateOperator_test_templates"
dag_id = "TestGcpStorageTransferJobCreateOperator"
ti = create_task_instance_of_operator(
CloudDataTransferServiceCreateJobOperator,
dag_id=dag_id,
Expand Down

0 comments on commit 2896623

Please sign in to comment.