Skip to content

Commit

Permalink
pkg.build
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Dec 28, 2024
1 parent 1ec19fd commit 9dc1160
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions api/python/quilt3/data_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ def add_put_options_safely(params: dict, put_options: Optional[dict]):
Add put options to the params dictionary safely.
This method ensures that the put options do not overwrite existing keys in the params dictionary.
"""
print(f"add_put_options_safely.put_options: {put_options}")
if put_options:
for key, value in put_options.items():
if key in params:
raise ValueError(f"Cannot override key `{key}` using put_options: {put_options}.")
params[key] = value
print(f"add_put_options_safely.PARAMS: {params}")


class S3Api(Enum):
Expand Down
4 changes: 4 additions & 0 deletions api/python/tests/integration/test_put_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ def test_package_push():
pkg = Package()
pkg.set(TEST_FILE, TEST_SRC)

with raises(ClientError, match=ERR_MSG):
pkg.build(pkg_name, TEST_BUCKET_URI)

with raises(ClientError, match=ERR_MSG):
pkg.push(pkg_name, TEST_BUCKET_URI, force=True)

pkg.build(pkg_name, TEST_BUCKET_URI, put_options=USE_KMS)
pkg.push(pkg_name, TEST_BUCKET_URI, put_options=USE_KMS, force=True)

# Use boto3 to verify the object was uploaded with the correct encryption
Expand Down

0 comments on commit 9dc1160

Please sign in to comment.