示例#1
0
def get_issues_s(request, run_id, case_id, build_id, environment_id=0):
    """Get the list of issues that are associated with this test case run

    :param int case_id: case ID.
    :param int run_id: run ID.
    :param int build_id: build ID.
    :param int environment_id: optional environment ID. Defaults to ``0``.
    :return: a list of found :class:`Issue`.
    :rtype: list[dict]

    Example::

        >>> TestCaseRun.get_issues_s(1, 2, 3, 4)
    """
    query = {
        'case_run__run': int(run_id),
        'case_run__build': int(build_id),
        'case_run__case': int(case_id),
    }
    # Just keep the same with original implementation that calls
    # pre_process_tcr_s. In which following logical exists. I don't why this
    # should happen there exactly.
    # FIXME: seems it should be `if environment_id is not None`, otherwise such
    # judgement should not happen.
    if environment_id:
        query['case_run__environment_id'] = int(environment_id)
    return Issue.to_xmlrpc(query)
示例#2
0
def get_issues_s(request, run_id, case_id, build_id, environment_id=0):
    """Get the list of issues that are associated with this test case run

    :param int case_id: case ID.
    :param int run_id: run ID.
    :param int build_id: build ID.
    :param int environment_id: optional environment ID. Defaults to ``0``.
    :return: a list of found :class:`Issue`.
    :rtype: list[dict]

    Example::

        TestCaseRun.get_issues_s(1, 2, 3, 4)
    """
    query = {
        'case_run__run': int(run_id),
        'case_run__build': int(build_id),
        'case_run__case': int(case_id),
    }
    # Just keep the same with original implementation that calls
    # pre_process_tcr_s. In which following logical exists. I don't why this
    # should happen there exactly.
    # FIXME: seems it should be `if environment_id is not None`, otherwise such
    # judgement should not happen.
    if environment_id:
        query['case_run__environment_id'] = int(environment_id)
    return Issue.to_xmlrpc(query)
示例#3
0
def get_issues(request, case_run_id):
    """Get the list of issues that are associated with this test case run

    :param int case_run_id: case run ID.
    :return: a list of mappings of :class:`Issue`.
    :rytpe: list[dict]

    Example::

        >>> TestCaseRun.get_issues(10)
    """
    query = {'case_run': int(case_run_id)}
    return Issue.to_xmlrpc(query)
示例#4
0
def get_issues(request, case_run_id):
    """Get the list of issues that are associated with this test case run

    :param int case_run_id: case run ID.
    :return: a list of mappings of :class:`Issue`.
    :rytpe: list[dict]

    Example::

        TestCaseRun.get_issues(10)
    """
    query = {'case_run': int(case_run_id)}
    return Issue.to_xmlrpc(query)
示例#5
0
def get_issues(request, run_ids):
    """Get the list of issues attached to this run.

    :param run_ids: give one or more run IDs. It could be an integer, a
        string containing comma separated IDs, or a list of int each of them is
        a run ID.
    :type run_ids: int, str or list
    :return: a list of mappings of :class:`Issue <tcms.issuetracker.models.Issue>`.
    :rtype: list[dict]

    Example::

        # Get issues belonging to ID 12345
        TestRun.get_issues(1)
        # Get issues belonging to run ids list [1, 2]
        TestRun.get_issues([1, 2])
        # Get issues belonging to run ids list 1 and 2 with string
        TestRun.get_issues('1, 2')
    """
    query = {'case_run__run__in': pre_process_ids(run_ids)}
    return Issue.to_xmlrpc(query)
示例#6
0
def get_issues(request, run_ids):
    """Get the list of issues attached to this run.

    :param run_ids: give one or more run IDs. It could be an integer, a
        string containing comma separated IDs, or a list of int each of them is
        a run ID.
    :type run_ids: int, str or list
    :return: a list of mappings of :class:`Issue <tcms.issuetracker.models.Issue>`.
    :rtype: list[dict]

    Example::

        # Get issues belonging to ID 12345
        >>> TestRun.get_issues(1)
        # Get issues belonging to run ids list [1, 2]
        >>> TestRun.get_issues([1, 2])
        # Get issues belonging to run ids list 1 and 2 with string
        >>> TestRun.get_issues('1, 2')
    """
    query = {'case_run__run__in': pre_process_ids(run_ids)}
    return Issue.to_xmlrpc(query)
示例#7
0
def get_issues(request, case_ids):
    """Get the list of issues that are associated with this test case.

    :param case_ids: give one or more case IDs. It could be an integer, a
        string containing comma separated IDs, or a list of int each of them is
        a case ID.
    :type case_ids: int, str or list
    :return: list of mappings of :class:`Issue`.
    :rtype: list[dict]

    Example::

        # Get issues belonging to case 1
        TestCase.get_issues(1)
        # Get issues belonging to cases [1, 2]
        TestCase.get_issues([1, 2])
        # Get issues belonging to case 1 and 2 with string
        TestCase.get_issues('1, 2')
    """
    case_ids = pre_process_ids(case_ids)
    query = {'case__in': case_ids}
    return Issue.to_xmlrpc(query)