greater granularity

This commit is contained in:
Chris Wolfe 2018-02-19 09:58:46 -06:00
commit 8ac4ff1e99
2 changed files with 20 additions and 12 deletions

View file

@ -463,15 +463,27 @@ def test_add_remove_list_tags_for_resource():
@mock_ssm
def test_send_command():
ssm_document = 'AWS-RunShellScript'
script = '#!/bin/bash\necho \'hello world\''
params = {'commands': ['#!/bin/bash\necho \'hello world\'']}
client = boto3.client('ssm', region_name='us-east-1')
before = datetime.datetime.now()
response = client.send_command(
InstanceIds=['i-123456'],
DocumentName=ssm_document,
TimeoutSeconds=60,
Parameters={'commands': [script]},
OutputS3BucketName='the-bucket'
Parameters=params,
OutputS3Region='us-east-2',
OutputS3BucketName='the-bucket',
OutputS3KeyPrefix='pref'
)
cmd = response['Command']
assert response['Command']
cmd['CommandId'].should_not.be(None)
cmd['DocumentName'].should.equal(ssm_document)
cmd['Parameters'].should.equal(params)
cmd['OutputS3Region'].should.equal('us-east-2')
cmd['OutputS3BucketName'].should.equal('the-bucket')
cmd['OutputS3KeyPrefix'].should.equal('pref')
cmd['ExpiresAfter'].should.be.greater_than(before)