diff --git a/tests/foreman/cli/test_host.py b/tests/foreman/cli/test_host.py index d68deace783..6d6b7ba43fe 100644 --- a/tests/foreman/cli/test_host.py +++ b/tests/foreman/cli/test_host.py @@ -2734,8 +2734,8 @@ def test_positive_host_registration_with_capsule( assert result.status == 0, f'Failed to register host: {result.stderr}' # Check output for "HTTP error code 422: Validation failed: Content view environment content facets is invalid" - assert "Validation failed" in str(result.stderr[1]), f"Error is: {result.stderr}" - assert "HTTP error code 422" in str(result.stderr[1]), f"Error is: {result.stderr}" + assert "Validation failed" in str(result.stderr), f"Error is: {result.stderr}" + assert "HTTP error code 422" in str(result.stderr), f"Error is: {result.stderr}" rhel_contenthost.unregister() # Re-register client with settings "validate_host_lce_content_source_coherence" is set to No @@ -2748,6 +2748,6 @@ def test_positive_host_registration_with_capsule( assert result.status == 0, f'Failed to register host: {result.stderr}' # Check output there should not any error like "Validation failed" or "HTTP error code 422" - assert "Validation failed" not in str(result.stderr[1]), f"Error is: {result.stderr}" - assert "HTTP error code 422" not in str(result.stderr[1]), f"Error is: {result.stderr}" + assert "Validation failed" not in str(result.stderr), f"Error is: {result.stderr}" + assert "HTTP error code 422" not in str(result.stderr), f"Error is: {result.stderr}" rhel_contenthost.unregister()