def test_command_failure_exit_code(windows_bash_session):
    """Test command execution that results in a non-zero exit code."""
    # Test a command that causes a script failure (e.g., invalid cmdlet)
    action = CmdRunAction(command='Get-NonExistentCmdlet')
    result = windows_bash_session.execute(action)

    assert isinstance(result, CmdOutputObservation)
    # Error should be captured in the output
    assert 'ERROR' in result.content
    assert (
        'is not recognized' in result.content
        or 'CommandNotFoundException' in result.content
    )
    assert result.exit_code == 1
Test command execution that results in a non-zero exit code.
tests/unit/test_windows_bash.py