Skip to content

Commit

Permalink
Tests: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnestaP committed May 28, 2024
1 parent 9f05882 commit e07f6ac
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dags/scoap3/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def get_country_ISO_name(country):

def upload_json_to_s3(json_record, repo):
file_in_bytes = io.BytesIO(json.dumps(json_record, indent=2).encode("utf-8"))
current_date = datetime.now().date()
current_date = datetime.datetime.now().date()
current_date_str = current_date.strftime("%Y-%m-%d")
current_date_and_time_str = current_date.strftime("%Y-%m-%d_%H:%M:%S")
doi = get_value(json_record, "dois.value[0]")
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/scoap3/integration/iop/test_iop_dag_pull_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_dag_run(dag, iop_empty_repo):
"pdf": "extracted/2022-09-24T03_01_43_content/1674-1137/1674-1137_46/1674-1137_46_10/1674-1137_46_10_103108/cpc_46_10_103108.pdf",
"xml": "extracted/2022-09-24T03_01_43_content/1674-1137/1674-1137_46/1674-1137_46_10/1674-1137_46_10_103108/cpc_46_10_103108.xml",
},
{"xml": "extracted/aca95c.xml/aca95c.xml"},
{"xml": "extracted/aca95c/aca95c.xml"},
]

assert sorted(iop_empty_repo.find_all(), key=lambda x: x.get("xml", "")) == sorted(
Expand All @@ -90,7 +90,7 @@ def test_dag_migrate_from_FTP(iop_empty_repo):
migrate_from_ftp(
sftp,
iop_empty_repo,
get_logger().bind(class_name="test_logge"),
get_logger().bind(class_name="test_logger"),
**{
"params": {
"excluded_directories": [],
Expand Down Expand Up @@ -149,7 +149,7 @@ def test_dag_migrate_from_FTP(iop_empty_repo):
"pdf": "extracted/2022-09-24T03_01_43_content/1674-1137/1674-1137_46/1674-1137_46_10/1674-1137_46_10_103108/cpc_46_10_103108.pdf",
"xml": "extracted/2022-09-24T03_01_43_content/1674-1137/1674-1137_46/1674-1137_46_10/1674-1137_46_10_103108/cpc_46_10_103108.xml",
},
{"xml": "extracted/aca95c.xml/aca95c.xml"},
{"xml": "extracted/aca95c/aca95c.xml"},
]
for (file_from_repo, expected_file) in zip(
iop_empty_repo.find_all(), expected_files
Expand Down
4 changes: 2 additions & 2 deletions tests/scoap3/integration/iop/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_pull_from_sftp(iop_empty_repo):
"pdf": "extracted/2022-09-24T03_01_43_content/1674-1137/1674-1137_46/1674-1137_46_10/1674-1137_46_10_103108/cpc_46_10_103108.pdf",
"xml": "extracted/2022-09-24T03_01_43_content/1674-1137/1674-1137_46/1674-1137_46_10/1674-1137_46_10_103108/cpc_46_10_103108.xml",
},
{"xml": "extracted/aca95c.xml/aca95c.xml"},
{"xml": "extracted/aca95c/aca95c.xml"},
]
assert iop_empty_repo.find_all() == expected_files
assert sorted(iop_empty_repo.get_all_raw_filenames()) == sorted(
Expand All @@ -84,6 +84,6 @@ def test_pull_from_sftp(iop_empty_repo):
"2022-09-01T03_01_40_content.zip",
"2022-09-03T03_01_49_content.zip",
"2022-09-24T03_01_43_content.zip",
"aca95c.xml.zip",
"aca95c.zip",
]
)
2 changes: 1 addition & 1 deletion tests/scoap3/units/iop/test_iop_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ def test_iop_sftp_path():
"2022-09-01T03_01_40_content.zip",
"2022-09-03T03_01_49_content.zip",
"2022-09-24T03_01_43_content.zip",
"aca95c.xml.zip",
"aca95c.zip",
]
)

0 comments on commit e07f6ac

Please sign in to comment.