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

TestQuerier.__init__()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
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