Skip to content

Commit

Permalink
Add tests for single and multiple options for the s3-env-file option
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmayer committed Aug 11, 2021
1 parent a62bab1 commit 3ad58de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def test_task_set_docker_label_exclusively(task_definition):
assert 'foo' in task_definition.containers[1]['dockerLabels']
assert 'new-var' in task_definition.containers[1]['dockerLabels']

def test_task_set_s3_env_file(task_definition):
def test_task_set_s3_env_file_multiple_files(task_definition):
assert len(task_definition.containers[0]['environmentFiles']) == 2

task_definition.set_s3_env_file(((u'webserver', u'arn:aws:s3:::mycompany.domain.com/app/.env'), (u'webserver', u'arn:aws:s3:::melted.cheese.com/grilled/.env'), (u'proxyserver', u'arn:ars:s3:::pizza/dev/.env')))
Expand All @@ -710,6 +710,14 @@ def test_task_set_s3_env_file(task_definition):
assert {'value': 'arn:aws:s3:::coolBuckets/dev/.env', 'type': 's3'} in task_definition.containers[0]['environmentFiles']
assert {'value': 'arn:aws:s3:::melted.cheese.com/grilled/.env', 'type': 's3'} in task_definition.containers[0]['environmentFiles']

def test_task_set_s3_env_file_single_file(task_definition):
assert len(task_definition.containers[0]['environmentFiles']) == 2

task_definition.set_s3_env_file(((u'webserver', u'arn:aws:s3:::mycompany.domain.com/app/.env')))

assert len(task_definition.containers[0]['environmentFiles']) == 3
# assert {'value': 'arn:aws:s3:::mycompany.domain.com/app/.env', 'type': 's3'} in task_definition.containers[0]['environmentFiles']

def test_task_set_s3_env_file_exclusively(task_definition):
assert len(task_definition.containers[0]['environmentFiles']) == 2

Expand Down

0 comments on commit 3ad58de

Please sign in to comment.