Skip to content

Adding example one_kms_cmk #158

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

Merged
merged 15 commits into from
Jun 10, 2019
Merged

Conversation

MeghaShetty
Copy link
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

import botocore.session
import pytest

from ..src.basic_encryption import cycle_string
from .examples_test_utils import get_cmk_arn
from .examples_test_utils import static_plaintext
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We prefer to have all imports from the same module in the same import statement.


def test_one_kms_cmk_streaming_data():
cmk_arn = get_cmk_arn()
handle, filename = tempfile.mkstemp()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use handle, so we should be explicit about that in its naming.

https://www.python.org/dev/peps/pep-0008/#method-names-and-instance-variables

Suggested change
handle, filename = tempfile.mkstemp()
_handle, filename = tempfile.mkstemp()

@mattsb42-aws
Copy link
Member

The AppVeyor failures are expected, unfortunately. We need to figure out why (#159), but they're failing across the board, not just for this PR.

for f in new_files:
os.remove(f)
finally:
os.close(_handle)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, that was my mistake. I missed that we do actually use this. Sorry about that.

Suggested change
os.close(_handle)
os.close(handle)


def test_one_kms_cmk_streaming_data():
cmk_arn = get_cmk_arn()
_handle, filename = tempfile.mkstemp()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_handle, filename = tempfile.mkstemp()
handle, filename = tempfile.mkstemp()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it back

@mattsb42-aws mattsb42-aws merged commit 1031f6e into aws:master Jun 10, 2019
@mattsb42-aws mattsb42-aws mentioned this pull request Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants