From c5e7b95dda55272061e4106dba77b1d1cecafc6a Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Tue, 20 Feb 2024 03:26:12 -0500 Subject: [PATCH] [6.14.z] Fix useless asserts in installer tests (#14129) Fix useless asserts in installer tests (#14099) fix useless asserts (cherry picked from commit 44ee8bf96b94c354b749be398189b01241b36eb5) Co-authored-by: rmynar <64528205+rmynar@users.noreply.github.com> --- 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 5b3f81ed9a0..a9de5a4ff0e 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -1743,7 +1743,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}', @@ -1753,7 +1756,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}',