Skip to content

Commit

Permalink
add test for list processing
Browse files Browse the repository at this point in the history
  • Loading branch information
troyready committed Aug 29, 2016
1 parent 1f2cf09 commit 3ef6e9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions stacker/actions/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ def resolve_parameters(parameters, blueprint, context, provider):
v_list.append(str(v).lower())
else:
v_list.append(v)
if v_list != []:
params[k] = ",".join(v_list)
params[k] = ",".join(v_list)
return params


Expand Down
9 changes: 9 additions & 0 deletions stacker/tests/actions/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ def test_resolve_parameters_none_conversion(self):
p = resolve_parameters(params, self.bp, self.ctx, self.prov)
self.assertNotIn("a", p)

def test_resolve_parameters_list_processing(self):
self.bp.parameters = {
"a": {
"type": "List",
"description": "A"}}
params = {"a": "Apple,Anchor"}
p = resolve_parameters(params, self.bp, self.ctx, self.prov)
self.assertEqual(p["a"], "Apple,Anchor")

def test_resolve_parameters_resolve_outputs(self):
self.bp.parameters = {
"a": {
Expand Down

0 comments on commit 3ef6e9a

Please sign in to comment.