Passed
Push — develop ( b8d4ca...421369 )
by Plexxi
07:01 queued 03:57
created

TestQuerier   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A query() 0 2 1
A __init__() 0 2 1
1
from st2common.query.base import Querier
2
from st2common.constants.action import LIVEACTION_STATUS_SUCCEEDED
3
4
5
class TestQuerier(Querier):
6
    def __init__(self, *args, **kwargs):
7
        super(TestQuerier, self).__init__(*args, **kwargs)
8
9
    def query(self, execution_id, query_context):
10
        return (LIVEACTION_STATUS_SUCCEEDED, {'called_with': {execution_id: query_context}})
11
12
13
def get_instance():
14
    return TestQuerier(query_interval=0.1, empty_q_sleep_time=0.2,
15
                       no_workers_sleep_time=0.1)
16