Skip to content

Commit ee02042

Browse files
committed
update_tests_for_opentsdb23
1 parent e2902cd commit ee02042

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

tests/test_opentsdb.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ def query_arrays_setup():
103103
}
104104
}
105105

106+
106107
def query_raw_data_setup():
107-
global jreq, jreq1, jreq2, jreq3
108+
global jreq, jreq1, jreq2, jreq3, jreq4
108109

109110
jreq = {'start': 1739214930519, 'end': 1739215230519, 'arrays': True,
110111
'inputQuery': {'aggregator': 'noop', 'downsample': '1m-avg',
@@ -117,7 +118,7 @@ def query_raw_data_setup():
117118
}
118119
}
119120
jreq1 = {'start': 1739214930519, 'end': 1739215230519, 'arrays': True,
120-
'inputQuery': {'aggregator': 'noop', 'downsample': '1m-avg',
121+
'inputQuery': {'aggregator': 'noop', 'downsample': '1m-avg',
121122
'filters': [
122123
{'filter': 'scale-11', 'groupBy': False,
123124
'tagk': 'node', 'type': 'pm_filter'
@@ -127,7 +128,7 @@ def query_raw_data_setup():
127128
}
128129
}
129130
jreq2 = {'start': 1739214930519, 'end': 1739215230519, 'arrays': True,
130-
'inputQuery': {'aggregator': 'noop', 'downsample': '1m-avg',
131+
'inputQuery': {'aggregator': 'noop', 'downsample': '1m-avg',
131132
'filters': [
132133
{'filter': 'scale-11', 'groupBy': False,
133134
'tagk': 'node', 'type': 'pm_filter'
@@ -136,6 +137,23 @@ def query_raw_data_setup():
136137
'shouldComputeRate': True, 'isCounter': True
137138
}
138139
}
140+
jreq3 = {'start':1746277483949, 'end': None,
141+
'inputQuery': {'aggregator': 'noop', 'downsampleAggregator': 'avg',
142+
'downsampleFillPolicy': 'none',
143+
'metric': 'cpu_contexts',
144+
'disableDownsampling': True,
145+
'explicitTags': True, 'index': 0
146+
}
147+
}
148+
jreq4 = {'start':1746277483949, 'end': None,
149+
'inputQuery': {'aggregator': 'noop', 'downsampleAggregator': 'avg',
150+
'downsampleFillPolicy': 'none',
151+
'metric': 'cpu_contexts',
152+
'disableDownsampling': True,
153+
'explicitTags': False, 'index': 0
154+
}
155+
}
156+
139157

140158

141159
@with_setup(my_setup)
@@ -245,3 +263,11 @@ def test_case08():
245263
args2 = {}
246264
args2['rawData'] = q2.get('explicitTags', False) or q2.get('isCounter', False)
247265
assert args2.get('rawData') == True
266+
q3 = jreq3.get('inputQuery')
267+
args3 = {}
268+
args3['rawData'] = q3.get('explicitTags', False) or q3.get('isCounter', False)
269+
assert args3.get('rawData') == True
270+
q4 = jreq4.get('inputQuery')
271+
args4 = {}
272+
args4['rawData'] = q4.get('explicitTags', False) or q4.get('isCounter', False)
273+
assert args4.get('rawData') == False

0 commit comments

Comments
 (0)