diff --git a/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py b/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py index 5f0c0d804629d65f74ea594703df034c816763bd..3629d88ee7feb6739ef2107e20bc98453cced8b7 100644 --- a/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py +++ b/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py @@ -18,7 +18,7 @@ def test_gnupg_private_keys_file_content(host): # The rstrip() is added because Ansible strips last newline # when using the file lookup plugin. - assert gnupg_private_keys.content == open('tests/data/gnupg/parameters-mandatory.asc', 'r').read().rstrip() + assert gnupg_private_keys.content_string == open('tests/data/gnupg/parameters-mandatory.asc', 'r').read().rstrip() def test_gnupg_public_keys_file_content(host): @@ -30,7 +30,7 @@ def test_gnupg_public_keys_file_content(host): with host.sudo(): gnupg_public_keys = host.file('/etc/duply/main/public_keys.asc') - assert gnupg_public_keys.content == "" + assert gnupg_public_keys.content_string == "" def test_backup_ssh_key_file_content(host): @@ -42,7 +42,7 @@ def test_backup_ssh_key_file_content(host): ssh_key = host.file('/etc/duply/main/ssh/identity') - assert ssh_key.content == open('tests/data/ssh/parameters-mandatory', 'r').read() + assert ssh_key.content_string == open('tests/data/ssh/parameters-mandatory', 'r').read() def test_known_hosts_content(host): @@ -54,7 +54,7 @@ def test_known_hosts_content(host): known_hosts = host.file('/etc/duply/main/ssh/known_hosts') - assert known_hosts.content == open('tests/data/ssh/parameters-mandatory-known_hosts', 'r').read() + assert known_hosts.content_string == open('tests/data/ssh/parameters-mandatory-known_hosts', 'r').read() def test_duply_configuration_content(host): @@ -66,11 +66,11 @@ def test_duply_configuration_content(host): duply_configuration = host.file('/etc/duply/main/conf') - assert "GPG_KEYS_ENC='59C26F031A129C54'" in duply_configuration.content - assert "GPG_KEY_SIGN='59C26F031A129C54'" in duply_configuration.content - assert "TARGET='pexpect+sftp://bak-parameters-mandatory-s64@10.31.127.10:2222//duplicity'" in duply_configuration.content + assert "GPG_KEYS_ENC='59C26F031A129C54'" in duply_configuration.content_string + assert "GPG_KEY_SIGN='59C26F031A129C54'" in duply_configuration.content_string + assert "TARGET='pexpect+sftp://bak-parameters-mandatory-s64@10.31.127.10:2222//duplicity'" in duply_configuration.content_string assert "DUPL_PARAMS=\"$DUPL_PARAMS --ssh-options='-oLogLevel=ERROR -oUserKnownHostsFile=/dev/null " \ - "-oGlobalKnownHostsFile=/etc/duply/main/ssh/known_hosts -oIdentityFile=/etc/duply/main/ssh/identity'\"" in duply_configuration.content + "-oGlobalKnownHostsFile=/etc/duply/main/ssh/known_hosts -oIdentityFile=/etc/duply/main/ssh/identity'\"" in duply_configuration.content_string def test_duply_gnupg_keyring_private_keys(host):