Skip to content

Commit

Permalink
Add tests for autogen policy on non dev stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesls committed Apr 3, 2017
1 parent aac2ed6 commit f83b636
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/deploy/test_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ def test_can_provide_stage_specific_policy_for_other_stage(app_policy,
assert generated == json.loads(previous_policy)


def test_autogen_policy_for_non_dev_stage(app_policy, in_memory_osutils):
in_memory_osutils.filemap['./app.py'] = ''
config = Config.create(
project_dir='.',
chalice_stage='prod',
autogen_policy=True,
)
generated = app_policy.generate_policy_from_app_source(config)
assert 'Statement' in generated
assert 'Version' in generated


def test_no_policy_generated_when_disabled_in_config(app_policy,
in_memory_osutils):
previous_policy = '{"Statement": ["foo"]}'
Expand Down

0 comments on commit f83b636

Please sign in to comment.