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

Pass user provided api gateway stage to config #325

Merged
merged 1 commit into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion chalice/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ def deploy(ctx, autogen_policy, profile, api_gateway_stage, stage,
factory = ctx.obj['factory'] # type: CLIFactory
factory.profile = profile
config = factory.create_config_obj(
chalice_stage_name=stage, autogen_policy=autogen_policy)
chalice_stage_name=stage, autogen_policy=autogen_policy,
api_gateway_stage=api_gateway_stage,
)
session = factory.create_botocore_session()
d = factory.create_default_deployer(session=session, prompter=click)
deployed_values = d.deploy(config, chalice_stage_name=stage)
Expand Down
15 changes: 15 additions & 0 deletions tests/functional/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,21 @@ def test_api_gateway_mutex_with_positional_arg(runner, mock_cli_factory,
assert not mock_deployer.deploy.called


def test_can_specify_api_gateway_stage(runner, mock_cli_factory,
mock_deployer):
with runner.isolated_filesystem():
cli.create_new_project_skeleton('testproject')
os.chdir('testproject')
result = _run_cli_command(runner, cli.deploy,
['--api-gateway-stage', 'notdev'],
cli_factory=mock_cli_factory)
assert result.exit_code == 0
mock_cli_factory.create_config_obj.assert_called_with(
autogen_policy=True, chalice_stage_name='dev',
api_gateway_stage='notdev'
)


def test_can_retrieve_url(runner, mock_cli_factory):
deployed_values = {
"dev": {
Expand Down