Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cloudinary/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ def explode(public_id, **options):

:param public_id: The public ID of the file to explode.
:type public_id: str
:param options: Additional explode options (format, notification_url, transformation).
:param options: Additional explode options (format, notification_url, batch_id, transformation).
:keyword str batch_id: Correlation key for the completion notification, used to address it
when polling.
:return: The result of the API call.
:rtype: dict
"""
Expand All @@ -583,6 +585,7 @@ def explode(public_id, **options):
"public_id": public_id,
"format": options.get("format"),
"notification_url": options.get("notification_url"),
"batch_id": options.get("batch_id"),
"transformation": utils.generate_transformation_string(**options)[0]
}
return call_api("explode", params, **options)
Expand Down
21 changes: 21 additions & 0 deletions test/test_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,27 @@ def test_various_upload_parameters(self, request_mock):
for param in options.keys():
self.assertIn(param, params)

@patch(URLLIB3_REQUEST)
def test_explode_parameters(self, request_mock):
"""Should support notification_url and batch_id in explode"""
request_mock.return_value = MOCK_RESPONSE

batch_id = "batch_{}".format(UNIQUE_ID)

uploader.explode(
TEST_ID,
page="all",
format="jpg",
notification_url="poll://*",
batch_id=batch_id,
)

params = get_params(request_mock)
self.assertEqual(params["public_id"], TEST_ID)
self.assertEqual(params["format"], "jpg")
self.assertEqual(params["notification_url"], "poll://*")
self.assertEqual(params["batch_id"], batch_id)

@unittest.skipUnless(cloudinary.config().api_secret, "requires api_key/api_secret")
def test_eval_upload_parameter(self):
"""Should support eval in upload"""
Expand Down
Loading