Skip to content
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

convert to use yaml.safe_load #122

Merged
merged 1 commit into from
Jan 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_cli.py
Expand Up @@ -54,7 +54,7 @@ def test_encrypt(tmpdir, kms_stub):

main(['encrypt-file', six.text_type(tmpfile)])

data = yaml.load(tmpfile.read())
data = yaml.safe_load(tmpfile.read())
assert data['MY_ENCRYPTED_VAR'] == {'encrypted': base64.b64encode(b'quux').decode('utf-8')}
assert data['MY_UNENCRYPTED_VAR'] == 'bar'
assert data['TREEHUGGER_APP'] == 'baz'
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_encrypt_different_key(tmpdir, kms_stub):

main(['-k', key_arn, 'encrypt-file', six.text_type(tmpfile)])

data = yaml.load(tmpfile.read())
data = yaml.safe_load(tmpfile.read())
assert data['MY_ENCRYPTED_VAR'] == {'encrypted': base64.b64encode(b'quux').decode('utf-8')}
assert data['MY_UNENCRYPTED_VAR'] == 'bar'
assert data['TREEHUGGER_APP'] == 'baz'
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_encrypt_different_key_env_var(tmpdir, kms_stub):
with mock.patch.dict(os.environ, {'TREEHUGGER_KEY': key_id}):
main(['encrypt-file', six.text_type(tmpfile)])

data = yaml.load(tmpfile.read())
data = yaml.safe_load(tmpfile.read())
assert data['MY_ENCRYPTED_VAR'] == {'encrypted': base64.b64encode(b'quux').decode('utf-8')}
assert data['MY_UNENCRYPTED_VAR'] == 'bar'
assert data['TREEHUGGER_APP'] == 'baz'
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_decrypt(tmpdir, kms_stub):

main(['decrypt-file', six.text_type(tmpfile)])

data = yaml.load(tmpfile.read())
data = yaml.safe_load(tmpfile.read())
assert data['MY_ENCRYPTED_VAR'] == {'to_encrypt': 'quux'}
assert data['MY_UNENCRYPTED_VAR'] == 'bar'
assert data['TREEHUGGER_APP'] == 'baz'
Expand Down