Passed
Push — master ( 3727b7...72c322 )
by Alexander
02:28
created

tcms.xmlrpc.api.testexecutionstatus.filter()   A

Complexity

Conditions 1

Size

Total Lines 13
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 13
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
# Copyright (c) 2019 Alexander Todorov <[email protected]>
2
3
# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
4
5
from modernrpc.core import rpc_method
6
7
from tcms.testruns.models import TestExecutionStatus
8
9
10
@rpc_method(name='TestCaseRunStatus.filter')
11
def filter(query):  # pylint: disable=redefined-builtin
12
    """
13
    .. function:: XML-RPC TestCaseRunStatus.filter(query)
14
15
        Search and return the list of test case run statuses.
16
17
        :param query: Field lookups for :class:`tcms.testruns.models.TestCaseRunStatus`
18
        :type query: dict
19
        :return: Serialized list of :class:`tcms.testruns.models.TestCaseRunStatus` objects
20
        :rtype: list(dict)
21
    """
22
    return TestExecutionStatus.to_xmlrpc(query)
23
24
25
# workaround for keeping backward-compatibility with users of the API calling TestCaseRunStatus.*
26
@rpc_method(name='TestExecutionStatus.filter')
27
def test_execution_filter(query):
28
    return filter(query)
29