tests/test_airflow_renv_operator.py
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
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.
    
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.
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 .
def make_subprocess_hook_mock(exit_code: int, output: str) -> Mock:
    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
def make_subprocess_hook_mock ( exit_code : int , output : str ) -> Mock : 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
Mock a SubprocessHook factory object for use in testing.
Mock a SubprocessHook factory object for use in testing .
"""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.
    """
exit_code
int
output
str