chore: ruff format

This commit is contained in:
Chris Coutinho
2025-06-06 19:11:31 +02:00
parent 5ee9435741
commit c1e3a6aeaa
3 changed files with 54 additions and 54 deletions
+21 -21
View File
@@ -173,13 +173,13 @@ async def test_attachments_cleanup_on_note_delete(
logger.error( logger.error(
f"Attachment directory still exists! PROPFIND returned {status}" f"Attachment directory still exists! PROPFIND returned {status}"
) )
assert ( assert False, (
False f"Expected attachment directory to be gone, but PROPFIND returned {status}!"
), f"Expected attachment directory to be gone, but PROPFIND returned {status}!" )
except HTTPStatusError as e: except HTTPStatusError as e:
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified attachment directory does not exist via PROPFIND (404 received)" "Verified attachment directory does not exist via PROPFIND (404 received)"
) )
@@ -283,13 +283,13 @@ async def test_attachments_category_change_handling(nc_client: NextcloudClient):
logger.error( logger.error(
f"Old attachment directory still exists! PROPFIND returned {status}" f"Old attachment directory still exists! PROPFIND returned {status}"
) )
assert ( assert False, (
False f"Expected old directory to be gone, but PROPFIND returned {status} - directory still exists!"
), f"Expected old directory to be gone, but PROPFIND returned {status} - directory still exists!" )
except HTTPStatusError as e: except HTTPStatusError as e:
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified old attachment directory does not exist via PROPFIND (404 received)" "Verified old attachment directory does not exist via PROPFIND (404 received)"
) )
@@ -315,9 +315,9 @@ async def test_attachments_category_change_handling(nc_client: NextcloudClient):
logger.error( logger.error(
f"New attachment directory not found! PROPFIND failed with {e.response.status_code}" f"New attachment directory not found! PROPFIND failed with {e.response.status_code}"
) )
assert ( assert False, (
False f"Expected new attachment directory to exist, but PROPFIND failed with {e.response.status_code}"
), f"Expected new attachment directory to exist, but PROPFIND failed with {e.response.status_code}" )
finally: finally:
# 6. Cleanup: Delete the note (client should use the *final* category for cleanup path) # 6. Cleanup: Delete the note (client should use the *final* category for cleanup path)
@@ -368,9 +368,9 @@ async def test_attachments_category_change_handling(nc_client: NextcloudClient):
]: # Successful PROPFIND means directory exists ]: # Successful PROPFIND means directory exists
assert False, "New category attachment directory still exists!" assert False, "New category attachment directory still exists!"
except HTTPStatusError as e: except HTTPStatusError as e:
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified new category attachment directory is gone via PROPFIND" "Verified new category attachment directory is gone via PROPFIND"
) )
@@ -389,9 +389,9 @@ async def test_attachments_category_change_handling(nc_client: NextcloudClient):
]: # Successful PROPFIND means directory exists ]: # Successful PROPFIND means directory exists
assert False, "Old category attachment directory still exists!" assert False, "Old category attachment directory still exists!"
except HTTPStatusError as e: except HTTPStatusError as e:
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified old category attachment directory is gone via PROPFIND" "Verified old category attachment directory is gone via PROPFIND"
) )
+9 -9
View File
@@ -99,9 +99,9 @@ async def test_note_with_embedded_image(
logger.error( logger.error(
f"Attachment directory not found! PROPFIND failed with {e.response.status_code}" f"Attachment directory not found! PROPFIND failed with {e.response.status_code}"
) )
assert ( assert False, (
False f"Expected attachment directory to exist, but PROPFIND failed with {e.response.status_code}"
), f"Expected attachment directory to exist, but PROPFIND failed with {e.response.status_code}" )
# 2. Update the note content to include the embedded image references # 2. Update the note content to include the embedded image references
updated_content = f"""{note_data["content"]} updated_content = f"""{note_data["content"]}
@@ -171,13 +171,13 @@ async def test_note_with_embedded_image(
logger.error( logger.error(
f"Attachment directory still exists! PROPFIND returned {status}" f"Attachment directory still exists! PROPFIND returned {status}"
) )
assert ( assert False, (
False f"Expected attachment directory to be gone, but PROPFIND returned {status}!"
), f"Expected attachment directory to be gone, but PROPFIND returned {status}!" )
except HTTPStatusError as e: except HTTPStatusError as e:
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified attachment directory does not exist via PROPFIND (404 received)" "Verified attachment directory does not exist via PROPFIND (404 received)"
) )
+24 -24
View File
@@ -108,17 +108,17 @@ async def test_category_change_cleans_up_old_attachments_directory(
logger.error( logger.error(
"ISSUE DETECTED: Was able to retrieve attachment from old category path!" "ISSUE DETECTED: Was able to retrieve attachment from old category path!"
) )
assert ( assert False, (
False "Old category attachment directory still exists and accessible!"
), "Old category attachment directory still exists and accessible!" )
except HTTPStatusError as e: except HTTPStatusError as e:
# This is the expected outcome - old directory should be gone # This is the expected outcome - old directory should be gone
logger.info( logger.info(
f"Correctly got error accessing old category path: {e.response.status_code}" f"Correctly got error accessing old category path: {e.response.status_code}"
) )
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected 404, got {e.response.status_code}"
), f"Expected 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified old category attachment directory is not accessible (good!)" "Verified old category attachment directory is not accessible (good!)"
) )
@@ -144,18 +144,18 @@ async def test_category_change_cleans_up_old_attachments_directory(
logger.error( logger.error(
f"Old attachment directory still exists! PROPFIND returned {status}" f"Old attachment directory still exists! PROPFIND returned {status}"
) )
assert ( assert False, (
False f"Expected old attachment directory to be gone, but it still exists (PROPFIND returned {status})!"
), f"Expected old attachment directory to be gone, but it still exists (PROPFIND returned {status})!" )
# If we got another status code (like 404), it's also good - the directory doesn't exist # If we got another status code (like 404), it's also good - the directory doesn't exist
logger.info( logger.info(
f"Verified old attachment directory does not exist (PROPFIND returned {status})" f"Verified old attachment directory does not exist (PROPFIND returned {status})"
) )
except HTTPStatusError as e: except HTTPStatusError as e:
# 404 is expected - directory should not exist # 404 is expected - directory should not exist
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified old attachment directory does not exist via PROPFIND (404 received)" "Verified old attachment directory does not exist via PROPFIND (404 received)"
) )
@@ -210,17 +210,17 @@ async def test_category_change_cleans_up_old_attachments_directory(
logger.error( logger.error(
f"New category attachment directory still exists! PROPFIND returned {status}" f"New category attachment directory still exists! PROPFIND returned {status}"
) )
assert ( assert False, (
False f"Expected new category attachment directory to be gone, but it still exists (PROPFIND returned {status})!"
), f"Expected new category attachment directory to be gone, but it still exists (PROPFIND returned {status})!" )
# If we got another status code (like 404), it's also good - the directory doesn't exist # If we got another status code (like 404), it's also good - the directory doesn't exist
logger.info( logger.info(
f"Verified new category attachment directory does not exist (PROPFIND returned {status})" f"Verified new category attachment directory does not exist (PROPFIND returned {status})"
) )
except HTTPStatusError as e: except HTTPStatusError as e:
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified new category attachment directory is gone via PROPFIND" "Verified new category attachment directory is gone via PROPFIND"
) )
@@ -241,17 +241,17 @@ async def test_category_change_cleans_up_old_attachments_directory(
logger.error( logger.error(
f"Old category attachment directory still exists! PROPFIND returned {status}" f"Old category attachment directory still exists! PROPFIND returned {status}"
) )
assert ( assert False, (
False f"Expected old category attachment directory to be gone, but it still exists (PROPFIND returned {status})!"
), f"Expected old category attachment directory to be gone, but it still exists (PROPFIND returned {status})!" )
# If we got another status code (like 404), it's also good - the directory doesn't exist # If we got another status code (like 404), it's also good - the directory doesn't exist
logger.info( logger.info(
f"Verified old category attachment directory does not exist (PROPFIND returned {status})" f"Verified old category attachment directory does not exist (PROPFIND returned {status})"
) )
except HTTPStatusError as e: except HTTPStatusError as e:
assert ( assert e.response.status_code == 404, (
e.response.status_code == 404 f"Expected PROPFIND to fail with 404, got {e.response.status_code}"
), f"Expected PROPFIND to fail with 404, got {e.response.status_code}" )
logger.info( logger.info(
"Verified old category attachment directory is gone via PROPFIND" "Verified old category attachment directory is gone via PROPFIND"
) )