Skip to content

Commit

Permalink
test: added "subfolder"
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPietrusky committed Mar 19, 2024
1 parent 18c510c commit 5435d6c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_rp_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ def test_bucket_endpoint_not_configured(self, mock_upload_image, mock_exists):
mock_exists.return_value = True
mock_upload_image.return_value = "simulated_uploaded/image.png"

outputs = {"node_id": {"images": [{"filename": "ComfyUI_00001_.png"}]}}
outputs = {
"node_id": {"images": [{"filename": "ComfyUI_00001_.png", "subfolder": ""}]}
}
job_id = "123"

result = rp_handler.process_output_images(outputs, job_id)
Expand All @@ -155,7 +157,9 @@ def test_bucket_endpoint_configured(self, mock_upload_image, mock_exists):
mock_upload_image.return_value = "http://example.com/uploaded/image.png"

# Define the outputs and job_id for the test
outputs = {"node_id": {"images": [{"filename": "ComfyUI_00001_.png"}]}}
outputs = {
"node_id": {"images": [{"filename": "ComfyUI_00001_.png", "subfolder": ""}]}
}
job_id = "123"

# Call the function under test
Expand Down Expand Up @@ -188,7 +192,9 @@ def test_bucket_image_upload_fails_env_vars_wrong_or_missing(
# When AWS credentials are wrong or missing, upload_image should return 'simulated_uploaded/...'
mock_upload_image.return_value = "simulated_uploaded/image.png"

outputs = {"node_id": {"images": [{"filename": "ComfyUI_00001_.png"}]}}
outputs = {
"node_id": {"images": [{"filename": "ComfyUI_00001_.png", "subfolder": ""}]}
}
job_id = "123"

result = rp_handler.process_output_images(outputs, job_id)
Expand Down

0 comments on commit 5435d6c

Please sign in to comment.