Skip to content

Commit e16b78c

Browse files
committed
tsdfileapi/test_file_api/MockLargeFilesFuse: Fix/optimise path used for created symlink
The variant compiled as per parent commit is correct but doesn't communicate intent very well -- the path of the created symbolic link isn't the upload folder path followed by the leaf of the _file name_ (it's already a "leaf" -- just the _name_ of the file, period) -- it could be the leaf of the full path to the mounted file _or_ just the name of the file. This commit changes the expression to better express intent, which also makes it look simpler, and remain equally correct.
1 parent a64788e commit e16b78c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tsdfileapi/test_file_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,8 +2892,7 @@ def test_uploading_very_large_file_in_chunks(self) -> None:
28922892
) # We need to know the uploading ID in advance -- the linking below depends on it to redirect writing by the API correctly
28932893
os.symlink(
28942894
write_mount.file_path,
2895-
Path(self.uploads_folder)
2896-
/ f"{Path(read_mount.file_name).parts[-1]}.{upload_id}",
2895+
Path(self.uploads_folder) / f"{read_mount.file_name}.{upload_id}",
28972896
) # Effectively redirect writing of the file that the API concatenates chunks in, to be done by our file-system; a _distinct_ mount is used because the file being uploaded _must be readable, while the file being written should have zero size if it exists (which it must since we redirect with a symbolic link)
28982897
self.start_new_resumable(
28992898
str(read_mount.file_path),

0 commit comments

Comments
 (0)