mirror of
https://github.com/akuker/RASCSI.git
synced 2025-07-18 20:24:22 +00:00
Refactor python code to address Sonarcloud issues (#900)
- copy/move/delete file class methods now take Path objects as arguments - The file download endpoint in the Web UI uses the safer download from dir method - Simplified logging - Merged nested if statements - Removed naked handling of unknown error states - Added fallback empty list for drive_properties, to avoid errors when json file is missing or broken - Move drive_properties to env[] - Constants for common error messages - Dummy variable for list comprehension
This commit is contained in:
@@ -201,7 +201,7 @@ def test_upload_file(http_client, delete_file):
|
||||
def test_download_file(http_client, create_test_image):
|
||||
file_name = create_test_image()
|
||||
|
||||
response = http_client.post("/files/download", data={"file": f"{IMAGES_DIR}/{file_name}"})
|
||||
response = http_client.post("/files/download", data={"file": file_name})
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.headers["content-type"] == "application/octet-stream"
|
||||
|
Reference in New Issue
Block a user