Ejemplo n.º 1
0
def setup_viewer_client(workspace,
                        uri='/',
                        auto_handle_connection=True,
                        session_token=None):
    # read port and host from the test config file
    port = import_test_cfg(workspace)['codechecker_cfg']['viewer_port']
    host = import_test_cfg(workspace)['codechecker_cfg']['viewer_host']

    return get_viewer_client(port=port,
                             host=host,
                             uri=uri,
                             auto_handle_connection=auto_handle_connection,
                             session_token=session_token)
Ejemplo n.º 2
0
def setup_viewer_client(workspace,
                        endpoint='/CodeCheckerService',
                        auto_handle_connection=True,
                        session_token=None,
                        proto='http'):
    # Read port and host from the test config file.
    codechecker_cfg = import_test_cfg(workspace)['codechecker_cfg']
    port = codechecker_cfg['viewer_port']
    host = codechecker_cfg['viewer_host']
    product = codechecker_cfg['viewer_product']

    if session_token is None:
        session_token = get_session_token(workspace)

    if session_token == '_PROHIBIT':
        session_token = None

    return get_viewer_client(host=host,
                             port=port,
                             product=product,
                             endpoint=endpoint,
                             auto_handle_connection=auto_handle_connection,
                             session_token=session_token,
                             protocol=proto)