kopia lustrzana https://github.com/simonw/s3-credentials
Only output the AccessKey part
rodzic
411358a5fa
commit
4cb848be9b
|
@ -159,7 +159,7 @@ def create(
|
|||
UserName=username,
|
||||
)
|
||||
log("Created access key for user: {}".format(username))
|
||||
click.echo(json.dumps(response, indent=4, default=str))
|
||||
click.echo(json.dumps(response["AccessKey"], indent=4, default=str))
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
|
|
@ -43,8 +43,10 @@ def test_create(mocker):
|
|||
boto3 = mocker.patch("boto3.client")
|
||||
boto3.return_value = Mock()
|
||||
boto3.return_value.create_access_key.return_value = {
|
||||
"Key": "key",
|
||||
"Secret": "secret",
|
||||
"AccessKey": {
|
||||
"AccessKeyId": "access",
|
||||
"SecretAccessKey": "secret",
|
||||
}
|
||||
}
|
||||
runner = CliRunner()
|
||||
with runner.isolated_filesystem():
|
||||
|
@ -53,7 +55,7 @@ def test_create(mocker):
|
|||
assert result.output == (
|
||||
"Attached policy s3.read-write.pytest-bucket-simonw-1 to user s3.read-write.pytest-bucket-simonw-1\n"
|
||||
"Created access key for user: s3.read-write.pytest-bucket-simonw-1\n"
|
||||
'{\n "Key": "key",\n "Secret": "secret"\n}\n'
|
||||
'{\n "AccessKeyId": "access",\n "SecretAccessKey": "secret"\n}\n'
|
||||
)
|
||||
assert [str(c) for c in boto3.mock_calls] == [
|
||||
"call('s3')",
|
||||
|
|
Ładowanie…
Reference in New Issue