Skip to content

Commit ab9dfaf

Browse files
committed
Test fixes so they work on GitHub actions.
1 parent 4a0bce7 commit ab9dfaf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/test_athr_srch_emails_and_reports.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ def test_create_project_reports_and_emails_tabular(publication_dict, config_dict
9696
expected_emails = load_json(os.path.join("tests", "testing_files", "athr_project_emails_tabular.json"))
9797
del expected_emails["creation_date"]
9898
## attachment for xlsx files is a filepath and it differs between OS's.
99-
del expected_emails["emails"][2]["attachment"]
99+
del expected_emails["emails"][1]["attachment"]
100100

101101
actual_emails = create_project_reports_and_emails(authors_by_project_dict_tabular, publication_dict, config_dict_tabular, TESTING_DIR)
102102
# with open(os.path.join("tests", "testing_files", "athr_project_emails_tabular_new.json"),'w') as jsonFile:
103103
# jsonFile.write(json.dumps(actual_emails, indent=2, sort_keys=True))
104104
del actual_emails["creation_date"]
105-
del actual_emails["emails"][2]["attachment"]
105+
del actual_emails["emails"][1]["attachment"]
106106

107107
dir_contents = os.listdir(TESTING_DIR)
108108
expected_num_of_project_reports = 5
@@ -243,13 +243,13 @@ def test_create_collaborators_reports_and_emails(publication_dict, config_dict):
243243

244244
expected_emails = load_json(os.path.join("tests", "testing_files", "collaborator_emails.json"))
245245
del expected_emails["creation_date"]
246-
del expected_emails["emails"][2]["attachment"]
246+
del expected_emails["emails"][3]["attachment"]
247247

248248
actual_emails = create_collaborators_reports_and_emails(publication_dict, config_dict, TESTING_DIR)
249249
# with open(os.path.join("tests", "testing_files", "collaborator_emails_new.json"),'w') as jsonFile:
250250
# jsonFile.write(json.dumps(actual_emails, indent=2, sort_keys=True))
251251
del actual_emails["creation_date"]
252-
del actual_emails["emails"][2]["attachment"]
252+
del actual_emails["emails"][3]["attachment"]
253253

254254
dir_contents = os.listdir(TESTING_DIR)
255255
expected_num_of_collaborator_reports = 4
@@ -536,7 +536,8 @@ def test_create_tabular_project_report_excel(publication_dict, config_dict, auth
536536

537537
assert "project_report.csv.xlsx" in dir_contents
538538

539-
df = pandas.read_excel(os.path.join(TESTING_DIR, "project_report.csv.xlsx"))
539+
df = pandas.read_excel(os.path.join(TESTING_DIR, "project_report.csv.xlsx"), keep_default_na=False)
540+
# df.to_csv(os.path.join("tests", "testing_files", "aaa.csv"), sep="\t", index=False, lineterminator="\n")
540541
assert list(df.columns) == list(report_attributes["columns"].keys())
541542
assert df.iloc[1].loc["Col1"] == 'No Authors'
542543
assert df.iloc[0].loc["Col2"] == "Hunter"

0 commit comments

Comments
 (0)