Fix bugs and update test

This commit is contained in:
Daniel Markstedt 2023-11-01 06:57:52 +09:00
parent 4f953aeaee
commit 1993adba33
5 changed files with 5 additions and 4 deletions

View File

@ -486,9 +486,9 @@ class FileCmds:
file_name = PurePath(url).name file_name = PurePath(url).name
iso_filename = Path(server_info["image_dir"]) / f"{file_name}.iso" iso_filename = Path(server_info["image_dir"]) / f"{file_name}.iso"
tmp_full_path = Path(tmp_dir) / file_name
with TemporaryDirectory() as tmp_dir: with TemporaryDirectory() as tmp_dir:
tmp_full_path = Path(tmp_dir) / file_name
req_proc = self.download_to_dir(quote(url, safe=URL_SAFE), tmp_full_path) req_proc = self.download_to_dir(quote(url, safe=URL_SAFE), tmp_full_path)
logging.info("Downloaded %s to %s", file_name, tmp_dir) logging.info("Downloaded %s to %s", file_name, tmp_dir)
if not req_proc["status"]: if not req_proc["status"]:

View File

@ -206,4 +206,4 @@ div.throttle-notice > div a:hover {
label.hidden { label.hidden {
display: none; display: none;
} }

View File

@ -47,6 +47,7 @@
type="application/javascript" type="application/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js" src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js"
integrity="PwiT+fWTPpIySx6DrH1FKraKo+LvVpOClsjx0TSdMYTKi7BR1hR149f4VHLUUnfA" integrity="PwiT+fWTPpIySx6DrH1FKraKo+LvVpOClsjx0TSdMYTKi7BR1hR149f4VHLUUnfA"
crossorigin="anonymous"
></script> ></script>
<script type="application/javascript"> <script type="application/javascript">

View File

@ -1454,7 +1454,7 @@ def check_backend_auth():
abort( abort(
403, 403,
"PiSCSI is password protected. " "PiSCSI is password protected. "
"Start the Web Interface with the --password parameter." "Start the Web Interface with the --password parameter.",
) )

View File

@ -362,7 +362,7 @@ def test_download_url_to_dir(env, httpserver, http_client, list_files, delete_fi
assert file_name in list_files() assert file_name in list_files()
assert ( assert (
response_data["messages"][0]["message"] response_data["messages"][0]["message"]
== f"{file_name} downloaded to {env['images_dir']}{subdir}" == f"Downloaded file to {env['images_dir']}{subdir}{file_name}"
) )
# Cleanup # Cleanup