-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put object options #4219
Open
drernie
wants to merge
17
commits into
master
Choose a base branch
from
put-object-options
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Put object options #4219
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
90e65db
optional put_options
drernie f16069b
public APIs
drernie 48c3c6f
update copy_mock
drernie 9108528
default to None
drernie 66985e4
Update CHANGELOG.md
drernie 19b36e8
extra_args=put_options
drernie ce7e128
lint
drernie 692b3f2
test put_options pass to copy_mock
drernie 22e3a27
update gendocs
drernie 1f45529
Bucket.md
drernie b9ec974
Merge branch 'master' into put-object-options
drernie e20cd5a
Merge branch 'master' into put-object-options
drernie 4c8436f
Merge branch 'master' into put-object-options
drernie 6cf089e
Merge branch 'master' into put-object-options
drernie 541ef1f
Fix typos from code review
drernie 9180b9b
Merge branch 'master' into put-object-options
drernie 2d21857
Merge branch 'master' into put-object-options
drernie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,30 +172,39 @@ def test_bucket_select(self): | |
|
||
def test_bucket_put_file(self): | ||
with patch("quilt3.bucket.copy_file") as copy_mock: | ||
opts = {'SSECustomerKey': 'FakeKey'} | ||
bucket = Bucket('s3://test-bucket') | ||
bucket.put_file(key='README.md', path='./README') # put local file to bucket | ||
bucket.put_file(key='README.md', path='./README', put_options=opts) | ||
# put local file to bucket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the comment should be either above or on the line it refers to |
||
|
||
copy_mock.assert_called_once_with( | ||
PhysicalKey.from_path('README'), PhysicalKey.from_url('s3://test-bucket/README.md')) | ||
PhysicalKey.from_path('README'), | ||
PhysicalKey.from_url('s3://test-bucket/README.md'), | ||
put_options=opts, | ||
) | ||
|
||
def test_bucket_put_dir(self): | ||
path = pathlib.Path(__file__).parent / 'data' | ||
bucket = Bucket('s3://test-bucket') | ||
opts = {'SSECustomerKey': 'FakeKey'} | ||
|
||
with patch("quilt3.bucket.copy_file") as copy_mock: | ||
bucket.put_dir('test', path) | ||
bucket.put_dir('test', path, opts) | ||
copy_mock.assert_called_once_with( | ||
PhysicalKey.from_path(str(path) + '/'), PhysicalKey.from_url('s3://test-bucket/test/')) | ||
PhysicalKey.from_path(str(path) + '/'), | ||
PhysicalKey.from_url('s3://test-bucket/test/'), put_options=opts) | ||
|
||
with patch("quilt3.bucket.copy_file") as copy_mock: | ||
bucket.put_dir('test/', path) | ||
bucket.put_dir('test/', path, opts) | ||
copy_mock.assert_called_once_with( | ||
PhysicalKey.from_path(str(path) + '/'), PhysicalKey.from_url('s3://test-bucket/test/')) | ||
PhysicalKey.from_path(str(path) + '/'), | ||
PhysicalKey.from_url('s3://test-bucket/test/'), put_options=opts) | ||
|
||
with patch("quilt3.bucket.copy_file") as copy_mock: | ||
bucket.put_dir('', path) | ||
bucket.put_dir('', path, opts) | ||
copy_mock.assert_called_once_with( | ||
PhysicalKey.from_path(str(path) + '/'), PhysicalKey.from_url('s3://test-bucket/')) | ||
PhysicalKey.from_path(str(path) + '/'), | ||
PhysicalKey.from_url('s3://test-bucket/'), put_options=opts) | ||
|
||
def test_remote_delete(self): | ||
self.s3_stubber.add_response( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't see where this argument is used.
also, this case is somewhat less straightforward, because there may be (and usually are) operations other than PutObject: create / update MPU, upload part -- what's the plan regarding those?