from unittest.mock import Mock


def mock_cli(mock_cli_basic, mock_transfer_client, mock_search_client,
             mock_profile, mock_transfer_log):
    """
    Returns a mock logged in pilot client. Storage is mocked with a custom
    object, so this does behave slightly differently than the real client.
    All methods that reach out to remote resources are mocked, you need to
    re-mock them to return the test data you want.
    """
    mock_cli_basic.transfer_file = Mock()
    mock_cli_basic.login = Mock()
    mock_cli_basic.logout = Mock()
    mock_cli_basic.get_full_search_entry = Mock(return_value=None)
    mock_cli_basic.search = Mock(return_value={'gmeta': []})
    mock_cli_basic.ls = Mock()
    mock_cli_basic.mkdir = Mock()
    mock_cli_basic.delete = Mock()
    mock_cli_basic.delete_entry = Mock()
    mock_cli_basic.get_auth_client = Mock()
    mock_cli_basic.get_http_client = Mock()
    return mock_cli_basic