From 57e103ba33ee6992ebbad7e9059e3def9368acc8 2020-01-07 00:59:41 From: Branko Majic Date: 2020-01-07 00:59:41 Subject: [PATCH] MAR-148: Fixed tests for php_website role (newline handling in output). --- diff --git a/roles/php_website/molecule/default/tests/test_parameters_mandatory.py b/roles/php_website/molecule/default/tests/test_parameters_mandatory.py index 5e351523536b4e077e8bead4207fdfae6c4c3b18..877d872744e0f8b9f06744511e711e0ce16b45ae 100644 --- a/roles/php_website/molecule/default/tests/test_parameters_mandatory.py +++ b/roles/php_website/molecule/default/tests/test_parameters_mandatory.py @@ -79,7 +79,7 @@ def test_website_application_user(host): with host.sudo(): umask = host.run("su -l web-parameters-mandatory -c 'bash -c umask'") - assert umask.stdout == '0007' + assert umask.stdout == '0007\n' def test_nginx_user(host): @@ -103,7 +103,7 @@ def test_forward_file(host): assert config.user == 'root' assert config.group == 'web-parameters-mandatory' assert config.mode == 0o640 - assert config.content == "root" + assert config.content == "root\n" def test_mail_forwarding(host): @@ -111,7 +111,7 @@ def test_mail_forwarding(host): Tests if mail forwarding works as expected. """ - hostname = host.run('hostname').stdout + hostname = host.run('hostname').stdout.strip() send = host.run('swaks --suppress-data --to web-parameters-mandatory@localhost') assert send.rc == 0 diff --git a/roles/php_website/molecule/default/tests/test_parameters_optional.py b/roles/php_website/molecule/default/tests/test_parameters_optional.py index 9dec0378d0592e0d68498e7cf31f3020f81529bc..c0bfca2c16836bb9b7e33056771c097190d23a26 100644 --- a/roles/php_website/molecule/default/tests/test_parameters_optional.py +++ b/roles/php_website/molecule/default/tests/test_parameters_optional.py @@ -79,7 +79,7 @@ def test_website_application_user(host): with host.sudo(): umask = host.run("su -l web-parameters-optional_local -c 'bash -c umask'") - assert umask.stdout == '0007' + assert umask.stdout == '0007\n' def test_nginx_user(host): @@ -103,7 +103,7 @@ def test_forward_file(host): assert config.user == 'root' assert config.group == 'web-parameters-optional_local' assert config.mode == 0o640 - assert config.content == "user" + assert config.content == "user\n" def test_mail_forwarding(host): @@ -111,7 +111,7 @@ def test_mail_forwarding(host): Tests if mail forwarding works as expected. """ - hostname = host.run('hostname').stdout + hostname = host.run('hostname').stdout.strip() send = host.run('swaks --suppress-data --to web-parameters-optional_local@localhost') assert send.rc == 0