Skip to content

Commit

Permalink
remove initial /
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Nov 22, 2023
1 parent b35d39e commit 00cd03b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion faassupervisor/storage/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def upload_output(self, output_dir_path):
provider_type = StrUtils.get_storage_type(output['storage_provider'])
provider_id = StrUtils.get_storage_id(output['storage_provider'])
for file_path in output_files:
file_name = file_path.replace(f'{output_dir_path}/', '').strip()
file_name = file_path.replace(f'{output_dir_path}/', '').strip().lstrip('/')
prefix_ok = False
suffix_ok = False
# Check prefixes
Expand Down
4 changes: 2 additions & 2 deletions test/unit/faassupervisor/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def test_upload_output(self, mock_minio, mock_s3, mock_get_files):
'/tmp/test/result-file.out',
'/tmp/test/file2.txt',
'/tmp/test/file2.out',
'/tmp/test/\nfile3.out'
'/tmp/test/\n/file3.out'
]
mock_get_files.return_value = files
StorageConfig().upload_output('/tmp/test')
Expand All @@ -274,7 +274,7 @@ def test_upload_output(self, mock_minio, mock_s3, mock_get_files):
self.assertEqual(mock_s3.call_args_list[i],
call(f, f.split('/')[3], 'bucket/folder'))
self.assertEqual(mock_s3.call_args_list[6],
call('/tmp/test/\nfile3.out', 'file3.out', 'bucket/folder'))
call('/tmp/test/\n/file3.out', 'file3.out', 'bucket/folder'))

# def test_upload_real_output(self):
# with mock.patch.dict('os.environ',
Expand Down

0 comments on commit 00cd03b

Please sign in to comment.