Exemplo n.º 1
0
def mock_box_session_2():
    mock_session = MagicMock(Session)
    # pylint:disable=protected-access
    mock_session._api_config = API()
    mock_session._client_config = Client()
    # pylint:enable=protected-access
    mock_session.get_url.side_effect = lambda *args, **kwargs: Session.get_url(
        mock_session, *args, **kwargs)
    return mock_session
Exemplo n.º 2
0
def mock_box_session(translator):
    mock_session = MagicMock(Session)
    # pylint:disable=protected-access
    mock_session._api_config = mock_session.api_config = API()
    mock_session._client_config = mock_session.client_config = Client()
    mock_session._proxy_config = mock_session.proxy_config = Proxy()
    # pylint:enable=protected-access
    mock_session.get_url.side_effect = lambda *args, **kwargs: Session.get_url(mock_session, *args, **kwargs)
    mock_session.translator = translator
    return mock_session