filr_rest: return folder_id as a string (#74367)
gitea-wip/passerelle/pipeline/pr-main This commit looks good Details
gitea/passerelle/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Emmanuel Cazenave 2023-02-09 18:14:05 +01:00
parent ed05841b58
commit a84e6bdcdb
2 changed files with 7 additions and 4 deletions

View File

@ -94,7 +94,7 @@ class Filr(BaseResource, HTTPResource):
root_folder_info = self._call('rest/folders/%s/library_folders' % root_folder_id)
for folder in root_folder_info.get('items', []):
if folder.get('title') == folder_name:
folder_id = folder.get('id')
folder_id = str(folder.get('id'))
break
else:
folder_info = self._call(
@ -102,7 +102,7 @@ class Filr(BaseResource, HTTPResource):
method='post',
json_data={'title': folder_name},
)
folder_id = folder_info['id']
folder_id = str(folder_info['id'])
# upload file
file_info = self._call(

View File

@ -49,7 +49,7 @@ def test_upload(app, connector):
json_resp = resp.json
assert json_resp['err'] == 0
assert json_resp['data'] == {
'folder_id': 5678,
'folder_id': '5678',
'file_info': {'id': '09c1c3fb530f562401531018f4270000'},
}
@ -75,7 +75,10 @@ def test_upload_with_folder_creation(app, connector):
resp = app.post_json('/filr-rest/filr/upload', params=params)
json_resp = resp.json
assert json_resp['err'] == 0
assert json_resp['data'] == {'folder_id': 82, 'file_info': {'id': '09c1c3fb530f562401531018f4270000'}}
assert json_resp['data'] == {
'folder_id': '82',
'file_info': {'id': '09c1c3fb530f562401531018f4270000'},
}
def test_share_folder(app, connector):