Skip to content

Commit

Permalink
NiFi: fixed test script.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-bit committed Sep 1, 2023
1 parent d767265 commit a448be7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nifi/user-scripts/tests/generate_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
str_file_name = "ex1.pdf"
tmp_pdf_path = "./test_files/" + str_file_name

tmp_pdf = open(tmp_pdf_path, "r+", encoding="utf-8", errors="ignore").read()
tmp_pdf = open(tmp_pdf_path, mode="rb").read()

csv_header = "file_name_id_no_ext|file_ext"

Expand All @@ -27,7 +27,7 @@
new_file_name_no_ext = str_file_name + "_" + uid
metadata_csv += "\n" + new_file_name_no_ext + "|pdf"

with open(os.path.join(day_dir_path, new_file_name_no_ext + ".pdf"), "w+") as file:
with open(os.path.join(day_dir_path, new_file_name_no_ext + ".pdf"), "wb") as file:
file.write(tmp_pdf)

with(open(os.path.join(day_dir_path, "metadata.csv"), "w+")) as csv_file:
Expand Down

0 comments on commit a448be7

Please sign in to comment.