From d8d8470ba37f17fc73d8c6757764cff358b23035 Mon Sep 17 00:00:00 2001 From: Radek Mynar Date: Fri, 16 Feb 2024 14:35:20 +0100 Subject: [PATCH] fix useless asserts --- tests/foreman/destructive/test_installer.py | 8 ++++++-- tests/foreman/installer/test_installer.py | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/foreman/destructive/test_installer.py b/tests/foreman/destructive/test_installer.py index ebfcfb8d50a..a020b66f96a 100644 --- a/tests/foreman/destructive/test_installer.py +++ b/tests/foreman/destructive/test_installer.py @@ -64,7 +64,10 @@ def test_installer_sat_pub_directory_accessibility(target_sat): https_curl_command = f'curl -i {target_sat.url}/pub/ -k' for command in [http_curl_command, https_curl_command]: accessibility_check = target_sat.execute(command) - assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' in accessibility_check.stdout.split('\r\n') + assert ( + 'HTTP/1.1 200 OK' in accessibility_check.stdout + or 'HTTP/2 200' in accessibility_check.stdout + ) target_sat.get( local_path='custom-hiera-satellite.yaml', remote_path=f'{custom_hiera_location}', @@ -74,7 +77,8 @@ def test_installer_sat_pub_directory_accessibility(target_sat): assert 'Success!' in command_output.stdout for command in [http_curl_command, https_curl_command]: accessibility_check = target_sat.execute(command) - assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' not in accessibility_check.stdout.split('\r\n') + assert 'HTTP/1.1 200 OK' not in accessibility_check.stdout + assert 'HTTP/2 200' not in accessibility_check.stdout target_sat.put( local_path='custom-hiera-satellite.yaml', remote_path=f'{custom_hiera_location}', diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index 93e59f2c537..9766412db85 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -1756,7 +1756,10 @@ def test_installer_cap_pub_directory_accessibility(capsule_configured): https_curl_command = f'curl -i {capsule_configured.url}/pub/ -k' for command in [http_curl_command, https_curl_command]: accessibility_check = capsule_configured.execute(command) - assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' in accessibility_check.stdout.split('\r\n') + assert ( + 'HTTP/1.1 200 OK' in accessibility_check.stdout + or 'HTTP/2 200' in accessibility_check.stdout + ) capsule_configured.get( local_path='custom-hiera-capsule.yaml', remote_path=f'{custom_hiera_location}', @@ -1766,7 +1769,8 @@ def test_installer_cap_pub_directory_accessibility(capsule_configured): assert 'Success!' in command_output.stdout for command in [http_curl_command, https_curl_command]: accessibility_check = capsule_configured.execute(command) - assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' not in accessibility_check.stdout.split('\r\n') + assert 'HTTP/1.1 200 OK' not in accessibility_check.stdout + assert 'HTTP/2 200' not in accessibility_check.stdout capsule_configured.put( local_path='custom-hiera-capsule.yaml', remote_path=f'{custom_hiera_location}',