from unittest.mock import Mock


def make_subprocess_hook_mock(exit_code: int, output: str) -> Mock:
    """Mock a SubprocessHook factory object for use in testing.

    This mock allows us to validate that the RenvOperator is executing
    subprocess commands as expected without running them for real.
    """
    result_mock = Mock()
    result_mock.exit_code = exit_code
    result_mock.output = output
    hook_instance_mock = Mock()
    hook_instance_mock.run_command = Mock(return_value=result_mock)
    hook_factory_mock = Mock(return_value=hook_instance_mock)
    return hook_factory_mock