Skip to content

Commit

Permalink
chore[fix]: Fix test_boto3_secretsmanager.py
Browse files Browse the repository at this point in the history
After upgrading moto to the most recent version, the test containing
the put_secret_value() method started to fail. As described in the boto3
documentation
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/secretsmanager.html#SecretsManager.Client.put_secret_value
if a "the secret doesn't already exist, use CreateSecret() instead."

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
  • Loading branch information
pvital authored and Ferenc- committed Mar 8, 2023
1 parent 75d8ecf commit 675829b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/clients/boto3/test_boto3_secretsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ def test_vanilla_list_secrets(secretsmanager):

def test_get_secret_value(secretsmanager):
result = None
secret_id = 'Uber_Password'

secretsmanager.put_secret_value(
SecretId='Uber_Password',
response = secretsmanager.create_secret(
Name=secret_id,
SecretBinary=b'password1',
SecretString='password1',
VersionStages=[
'string',
]
)


assert response['Name'] == secret_id

with tracer.start_active_span('test'):
result = secretsmanager.get_secret_value(SecretId="Uber_Password")
result = secretsmanager.get_secret_value(SecretId=secret_id)

assert result['Name'] == 'Uber_Password'
assert result['Name'] == secret_id

spans = tracer.recorder.queued_spans()
assert len(spans) == 2
Expand Down

0 comments on commit 675829b

Please sign in to comment.