Skip to content

Commit

Permalink
Adjust return value for new changes to main
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed May 16, 2024
1 parent fcae103 commit 9f39576
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libsys_airflow/plugins/data_exports/transmission_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ def is_production():


def return_success_test_instance(files) -> dict:
return {"success": files, "failures": []}
return {"success": files["file_list"], "failures": []}
13 changes: 7 additions & 6 deletions tests/data_exports/test_transmission_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ def test_transmit_data_ftp_task(
return_value=mock_ftphook_connection,
)

transmit_data = transmit_data_ftp_task.function("ftp-example.com", mock_marc_files)
assert len(transmit_data["success"]) == 3
assert "Start transmission of file" in caplog.text
assert ftp_hook.store_file.called_with(
"/remote/path/dir/2024022914.mrc", "2024022914.mrc"
)
with mock.patch.dict("os.environ", AIRFLOW_VAR_OKAPI_URL="http://okapi-prod"):
transmit_data = transmit_data_ftp_task.function("ftp-example.com", mock_marc_files)
assert len(transmit_data["success"]) == 3
assert "Start transmission of file" in caplog.text
assert ftp_hook.store_file.called_with(
"/remote/path/dir/2024022914.mrc", "2024022914.mrc"
)


def test_transmit_data_task(
Expand Down

0 comments on commit 9f39576

Please sign in to comment.