Skip to content

Commit e8963db

Browse files
author
Bartek Kwiecien
committed
Added double quotes for path param in store task
1 parent 1057f12 commit e8963db

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

filestack/mixins/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def store(self, filename=None, location=None, path=None, container=None,
6464
Returns:
6565
:class:`filestack.Filelink`: new Filelink object
6666
"""
67+
if path:
68+
path = '"{}"'.format(path)
6769
instance = self._add_transform_task('store', locals())
6870
response = requests.post(instance.url)
6971
return filestack.models.Filelink(handle=response.json()['handle'])

tests/transformation_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,10 @@ def test_no_metadata(transform):
310310
def test_chain_tasks_and_store(post_mock, transform):
311311
post_mock.return_value = DummyHttpResponse(json_dict={'handle': HANDLE})
312312
transform_obj = transform.flip().resize(width=100)
313-
new_filelink = transform_obj.store(filename='filename', location='S3', container='bucket')
313+
new_filelink = transform_obj.store(filename='filename', location='S3', container='bucket', path='folder/image.jpg')
314314
assert new_filelink.handle == HANDLE
315315
post_mock.assert_called_once_with(
316-
'{}/{}/flip/resize=width:100/store=container:bucket,filename:filename,location:S3/{}'.format(
316+
'{}/{}/flip/resize=width:100/store=container:bucket,filename:filename,location:S3,path:"folder/image.jpg"/{}'.format(
317317
config.CDN_URL, APIKEY, EXTERNAL_URL
318318
)
319319
)

0 commit comments

Comments
 (0)