mirror of
https://github.com/akuker/RASCSI.git
synced 2025-07-17 13:24:08 +00:00
WebUI: Traverse target dir to get subdirs to download/upload to (#1115)
This commit is contained in:
@@ -207,7 +207,8 @@ def test_extract_file(
|
||||
http_client.post(
|
||||
"/files/download_url",
|
||||
data={
|
||||
"destination": "images",
|
||||
"destination": "disk_images",
|
||||
"images_subdir": "/",
|
||||
"url": url,
|
||||
},
|
||||
)
|
||||
@@ -254,7 +255,7 @@ def test_upload_file(http_client, delete_file):
|
||||
|
||||
form_data = {
|
||||
"destination": "disk_images",
|
||||
"subdir": "",
|
||||
"images_subdir": "/",
|
||||
"dzuuid": str(uuid.uuid4()),
|
||||
"dzchunkindex": chunk_number,
|
||||
"dzchunksize": chunk_size,
|
||||
@@ -334,6 +335,7 @@ def test_download_properties(http_client, list_files, delete_file):
|
||||
def test_download_url_to_dir(env, httpserver, http_client, list_files, delete_file):
|
||||
file_name = str(uuid.uuid4())
|
||||
http_path = f"/images/{file_name}"
|
||||
subdir = "/"
|
||||
url = httpserver.url_for(http_path)
|
||||
|
||||
with open("tests/assets/test_image.hds", mode="rb") as file:
|
||||
@@ -347,7 +349,8 @@ def test_download_url_to_dir(env, httpserver, http_client, list_files, delete_fi
|
||||
response = http_client.post(
|
||||
"/files/download_url",
|
||||
data={
|
||||
"destination": "images",
|
||||
"destination": "disk_images",
|
||||
"images_subdir": subdir,
|
||||
"url": url,
|
||||
},
|
||||
)
|
||||
@@ -358,7 +361,8 @@ def test_download_url_to_dir(env, httpserver, http_client, list_files, delete_fi
|
||||
assert response_data["status"] == STATUS_SUCCESS
|
||||
assert file_name in list_files()
|
||||
assert (
|
||||
response_data["messages"][0]["message"] == f"{file_name} downloaded to {env['images_dir']}"
|
||||
response_data["messages"][0]["message"]
|
||||
== f"{file_name} downloaded to {env['images_dir']}{subdir}"
|
||||
)
|
||||
|
||||
# Cleanup
|
||||
|
Reference in New Issue
Block a user