Skip to content

Commit

Permalink
Merge pull request #815 from awslabs/develop
Browse files Browse the repository at this point in the history
chore: v0.8.1 Release
  • Loading branch information
jfuss authored Nov 30, 2018
2 parents b428871 + a9a6d12 commit b493394
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion samcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
SAM CLI version
"""

__version__ = '0.8.0'
__version__ = '0.8.1'
1 change: 0 additions & 1 deletion samcli/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def callback(ctx, param, value):
return click.option('--region',
expose_value=False,
help='Set the AWS Region of the service (e.g. us-east-1).',
default='us-east-1',
callback=callback)(f)


Expand Down
29 changes: 29 additions & 0 deletions tests/integration/local/invoke/test_integrations_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import shutil
import os
import copy

from nose_parameterized import parameterized
from subprocess import Popen, PIPE
Expand Down Expand Up @@ -176,6 +177,34 @@ def test_invoke_with_env_using_parameters_with_custom_region(self):

self.assertEquals(environ["Region"], custom_region)

def test_invoke_with_env_with_aws_creds(self):
custom_region = "my-custom-region"
key = "key"
secret = "secret"
session = "session"

command_list = self.get_command_list("EchoEnvWithParameters",
template_path=self.template_path,
event_path=self.event_path)

env = copy.deepcopy(dict(os.environ))
env["AWS_DEFAULT_REGION"] = custom_region
env["AWS_REGION"] = custom_region
env["AWS_ACCESS_KEY_ID"] = key
env["AWS_SECRET_ACCESS_KEY"] = secret
env["AWS_SESSION_TOKEN"] = session

process = Popen(command_list, stdout=PIPE, env=env)
process.wait()
process_stdout = b"".join(process.stdout.readlines()).strip()
environ = json.loads(process_stdout.decode('utf-8'))

self.assertEquals(environ["AWS_DEFAULT_REGION"], custom_region)
self.assertEquals(environ["AWS_REGION"], custom_region)
self.assertEquals(environ["AWS_ACCESS_KEY_ID"], key)
self.assertEquals(environ["AWS_SECRET_ACCESS_KEY"], secret)
self.assertEquals(environ["AWS_SESSION_TOKEN"], session)

def test_invoke_with_docker_network_of_host(self):
command_list = self.get_command_list("HelloWorldServerlessFunction",
template_path=self.template_path,
Expand Down

0 comments on commit b493394

Please sign in to comment.