address @efiop's suggestions

This commit is contained in:
Mr. Outis
2019-11-29 12:38:12 -06:00
parent 845cd352f7
commit 1f9a0f0e0f
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -213,11 +213,11 @@ class RemoteS3(RemoteBASE):
return path_info.path == fname or fname.startswith(dir_path.path)
def makedirs(self, path_info):
# We need to support creating empty directories, on S3, that means
# We need to support creating empty directories, which means
# creating an object with an empty body and a trailing slash `/`.
#
# We are not creating directory objects for every parent prefix,
# it doesn't make sense.
# as it is not required.
dir_path = path_info / ""
self.s3.put_object(Bucket=path_info.bucket, Key=dir_path.path, Body="")
+2 -2
View File
@@ -103,8 +103,8 @@ def test_copy_preserve_etag_across_buckets(remote):
assert from_etag == to_etag
def makedirs(remote):
empty_dir = remote.path_info / "empty_dir"
def test_makedirs(remote):
empty_dir = remote.path_info / "empty_dir" / ""
remote.remove(empty_dir)
assert not remote.exists(empty_dir)
remote.makedirs(empty_dir)