grr/test_lib/flow_test_lib.py
def StartAndRunFlow(flow_cls,
                    client_mock=None,
                    client_id=None,
                    check_flow_errors=True,
                    **kwargs):
  """Builds a test harness (client and worker), starts the flow and runs it.

  Args:
    flow_cls: Flow class that will be created and run.
    client_mock: Client mock object.
    client_id: Client id of an emulated client.
    check_flow_errors: If True, raise on errors during flow execution.
    **kwargs: Arbitrary args that will be passed to flow.StartFlow().

  Returns:
    The session id of the flow that was run.
  """
  with TestWorker(token=True) as worker:
    flow_id = flow.StartFlow(flow_cls=flow_cls, client_id=client_id, **kwargs)

    RunFlow(
        client_id,
        flow_id,
        client_mock=client_mock,
        check_flow_errors=check_flow_errors,
        worker=worker)
    return flow_id
Builds a test harness (client and worker), starts the flow and runs it.

  Args:
    flow_cls: Flow class that will be created and run.
    client_mock: Client mock object.
    client_id: Client id of an emulated client.
    check_flow_errors: If True, raise on errors during flow execution.
    **kwargs: Arbitrary args that will be passed to flow.StartFlow().

  Returns:
    The session id of the flow that was run.
  
Builds a test harness (client and worker), starts the flow and runs it.
Builds a test harness ( client and worker ) starts the flow and runs it .
def StartAndRunFlow(flow_cls,
                    client_mock=None,
                    client_id=None,
                    check_flow_errors=True,
                    **kwargs):
  with TestWorker(token=True) as worker:
    flow_id = flow.StartFlow(flow_cls=flow_cls, client_id=client_id, **kwargs)
    RunFlow(
        client_id,
        flow_id,
        client_mock=client_mock,
        check_flow_errors=check_flow_errors,
        worker=worker)
    return flow_id
def StartAndRunFlow ( flow_cls , client_mock = None , client_id = None , check_flow_errors = True , ** kwargs ) : with TestWorker ( token = True ) as worker : flow_id = flow . StartFlow ( flow_cls = flow_cls , client_id = client_id , ** kwargs ) RunFlow ( client_id , flow_id , client_mock = client_mock , check_flow_errors = check_flow_errors , worker = worker ) return flow_id
Builds a test harness (client and worker), starts the flow and runs it.
Builds a test harness ( client and worker ) starts the flow and runs it .
"""Builds a test harness (client and worker), starts the flow and runs it.

  Args:
    flow_cls: Flow class that will be created and run.
    client_mock: Client mock object.
    client_id: Client id of an emulated client.
    check_flow_errors: If True, raise on errors during flow execution.
    **kwargs: Arbitrary args that will be passed to flow.StartFlow().

  Returns:
    The session id of the flow that was run.
  """
The session id of the flow that was run.
The session id of the flow that was run .
flow_cls
Flow class that will be created and run.
Flow class that will be created and run .
client_mock
Client mock object.
Client mock object .
client_id
Client id of an emulated client.
Client id of an emulated client .
check_flow_errors
If True, raise on errors during flow execution.
If True raise on errors during flow execution .
**kwargs
Arbitrary args that will be passed to flow.StartFlow().
Arbitrary args that will be passed to flow . StartFlow () .