Skip to content

Commit f5294c3

Browse files
author
Bartek Kwiecien
committed
Merge branch 'release/3.2.1'
2 parents 87a2abd + ba5609b commit f5294c3

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Filestack-Python Changelog
22

3+
### 3.2.1 (July 22nd, 2020)
4+
- FS-7797 changed http method used when uploading external urls
5+
36
### 3.2.0 (June 2nd, 2020)
47
- Added upload tags
58

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.0
1+
3.2.1

filestack/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '3.2.0'
1+
__version__ = '3.2.1'
22

33

44
class CFG:

filestack/uploads/external_url.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ def upload_external_url(url, apikey, store_params=None, security=None):
3131
if security is not None:
3232
url_elements.insert(3, security.as_url_string())
3333

34-
response = requests.post('/'.join(url_elements))
34+
# TODO: use processing endpoint and "store" task for uploading external urls
35+
response = requests.get('/'.join(url_elements))
3536
return response.json()['handle']

tests/client_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_wrong_storage():
2929

3030

3131
def test_store_external_url(client):
32-
@urlmatch(netloc=r'cdn.filestackcontent\.com', method='post', scheme='https')
32+
@urlmatch(netloc=r'cdn.filestackcontent\.com', method='get', scheme='https')
3333
def api_store(url, request):
3434
return response(200, {'handle': HANDLE})
3535

tests/uploads/test_upload_external_url.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
apikey = 'TESTAPIKEY'
1414

1515

16-
@patch('filestack.uploads.external_url.requests.post')
16+
@patch('filestack.uploads.external_url.requests.get')
1717
def test_upload(post_mock):
1818
post_mock.return_value = DummyHttpResponse(json_dict={'handle': 'newHandle'})
1919

@@ -31,7 +31,7 @@ def test_upload(post_mock):
3131
'store=container:bucket-name,workflows:["uuid-1","uuid-2"]'
3232
],
3333
])
34-
@patch('filestack.uploads.external_url.requests.post')
34+
@patch('filestack.uploads.external_url.requests.get')
3535
def test_upload_with_store_params(post_mock, store_params, expected_store_task):
3636
post_mock.return_value = DummyHttpResponse(json_dict={'handle': 'newHandle'})
3737

@@ -42,7 +42,7 @@ def test_upload_with_store_params(post_mock, store_params, expected_store_task):
4242
assert expected_store_task in req_url
4343

4444

45-
@patch('filestack.uploads.external_url.requests.post')
45+
@patch('filestack.uploads.external_url.requests.get')
4646
def test_upload_with_security(post_mock):
4747
post_mock.return_value = DummyHttpResponse(json_dict={'handle': 'newHandle'})
4848
security = Security({'expiry': 123123123123, 'call': ['write']}, 'SECRET')
@@ -54,7 +54,7 @@ def test_upload_with_security(post_mock):
5454
post_mock.assert_called_once_with(expected_url)
5555

5656

57-
@patch('filestack.uploads.external_url.requests.post')
57+
@patch('filestack.uploads.external_url.requests.get')
5858
def test_upload_exception(post_mock):
5959
error_message = 'Oops!'
6060
post_mock.side_effect = Exception(error_message)

0 commit comments

Comments
 (0)