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

tcms.xmlrpc.api.testexecutionstatus   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A filter() 0 13 1
A test_execution_filter() 0 3 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