From 4945f4591db6d8bb83f9ef607ba48aac3118d6c0 Mon Sep 17 00:00:00 2001 From: Sam McKelvie Date: Fri, 13 Oct 2017 14:20:36 -0700 Subject: [PATCH] Make tests pass with old and new terraform --- test/test_terraform.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/test_terraform.py b/test/test_terraform.py index c0111d2..e8c9891 100644 --- a/test/test_terraform.py +++ b/test/test_terraform.py @@ -35,8 +35,8 @@ CMD_CASES = [ [ [ lambda x: x.cmd('plan', 'var_to_output', no_color=IsFlagged, var={'test_var': 'test'}) , - #"doesn't need to do anything", - "no\nactions need to be performed", + ["doesn't need to do anything", + "no\nactions need to be performed"], 0, False, '', @@ -151,7 +151,16 @@ class TestTerraform(object): logs = string_logger() logs = logs.replace('\n', '') - assert expected_output in out + 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_ret_code == ret assert expected_logs in logs