From ffd9e1de2a9ed60036be5edf3e52bf8954277528 Mon Sep 17 00:00:00 2001 From: aubustou Date: Tue, 20 Oct 2020 00:24:33 +0200 Subject: [PATCH] Fix tests --- test/test_terraform.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/test_terraform.py b/test/test_terraform.py index b8a79a5..96e8dd6 100644 --- a/test/test_terraform.py +++ b/test/test_terraform.py @@ -50,7 +50,7 @@ CMD_CASES = [ '', 1, False, - 'command: terraform import -no-color aws_instance.foo i-abcd1234', + 'Command: terraform import -no-color aws_instance.foo i-abcd1234', '' ], # try import aws instance with raise_on_error @@ -59,7 +59,7 @@ CMD_CASES = [ '', 1, True, - 'command: terraform import -no-color aws_instance.foo i-abcd1234', + 'Command: terraform import -no-color aws_instance.foo i-abcd1234', '' ], # test with space and special character in file path @@ -77,7 +77,7 @@ CMD_CASES = [ '', 0, False, - 'command: terraform workspace show -no-color', + 'Command: terraform workspace show -no-color', '' ], ] @@ -181,7 +181,7 @@ class TestTerraform(object): ret = e.returncode out = e.out err = e.err - + logs = string_logger() logs = logs.replace('\n', '') if isinstance(expected_output, list): @@ -362,8 +362,8 @@ class TestTerraform(object): def test_import(self, string_logger): tf = Terraform(working_dir=current_path) tf.import_cmd('aws_instance.foo', 'i-abc1234', no_color=IsFlagged) - assert 'command: terraform import -no-color aws_instance.foo i-abc1234' in string_logger() - + assert 'Command: terraform import -no-color aws_instance.foo i-abc1234' in string_logger() + def test_create_workspace(self, workspace_setup_teardown): workspace_name = 'test' with workspace_setup_teardown(workspace_name, create=False) as tf: @@ -384,7 +384,7 @@ class TestTerraform(object): logs = string_logger() logs = logs.replace('\n', '') - expected_log = 'command: terraform workspace new -no-color test {}'.format(current_path) + expected_log = 'Command: terraform workspace new -no-color test {}'.format(current_path) assert expected_log in logs def test_set_workspace(self, workspace_setup_teardown): @@ -405,7 +405,7 @@ class TestTerraform(object): logs = string_logger() logs = logs.replace('\n', '') - expected_log = 'command: terraform workspace select -no-color test {}'.format(current_path) + expected_log = 'Command: terraform workspace select -no-color test {}'.format(current_path) assert expected_log in logs def test_show_workspace(self, workspace_setup_teardown): @@ -427,7 +427,7 @@ class TestTerraform(object): logs = string_logger() logs = logs.replace('\n', '') - expected_log = 'command: terraform workspace show -no-color' + expected_log = 'Command: terraform workspace show -no-color' assert expected_log in logs def test_delete_workspace(self, workspace_setup_teardown): @@ -453,5 +453,5 @@ class TestTerraform(object): logs = string_logger() logs = logs.replace('\n', '') - expected_log = 'command: terraform workspace delete -force test {}'.format(current_path) + expected_log = 'Command: terraform workspace delete -force test {}'.format(current_path) assert expected_log in logs