Make tests pass with old and new terraform

This commit is contained in:
Sam McKelvie 2017-10-13 14:20:36 -07:00
parent 723ab0b79e
commit 4945f4591d

View file

@ -35,8 +35,8 @@ CMD_CASES = [
[ [
[ [
lambda x: x.cmd('plan', 'var_to_output', no_color=IsFlagged, var={'test_var': 'test'}) , lambda x: x.cmd('plan', 'var_to_output', no_color=IsFlagged, var={'test_var': 'test'}) ,
#"doesn't need to do anything", ["doesn't need to do anything",
"no\nactions need to be performed", "no\nactions need to be performed"],
0, 0,
False, False,
'', '',
@ -151,6 +151,15 @@ class TestTerraform(object):
logs = string_logger() logs = string_logger()
logs = logs.replace('\n', '') logs = logs.replace('\n', '')
if isinstance(expected_output, list):
ok = False
for xo in expected_output:
if xo in out:
ok = True
break
if not ok:
assert expected_output[0] in out
else:
assert expected_output in out assert expected_output in out
assert expected_ret_code == ret assert expected_ret_code == ret
assert expected_logs in logs assert expected_logs in logs