@@ -131,6 +131,8 @@ def test_prometheus_minimal_config_empty_extra_args(self):
131131 expected_output ['metric_one' ]['groupby' ].append ('project_id' )
132132 expected_output ['metric_one' ]['extra_args' ] = {
133133 'aggregation_method' : 'max' ,
134+ 'query_prefix' : '' ,
135+ 'query_suffix' : '' ,
134136 }
135137 self .assertEqual (
136138 collector .prometheus .PrometheusCollector .check_configuration (data ),
@@ -143,6 +145,8 @@ def test_prometheus_minimal_config_no_extra_args(self):
143145 expected_output ['metric_one' ]['groupby' ].append ('project_id' )
144146 expected_output ['metric_one' ]['extra_args' ] = {
145147 'aggregation_method' : 'max' ,
148+ 'query_prefix' : '' ,
149+ 'query_suffix' : '' ,
146150 }
147151 self .assertEqual (
148152 collector .prometheus .PrometheusCollector .check_configuration (data ),
@@ -154,13 +158,17 @@ def test_prometheus_minimal_config_minimal_extra_args(self):
154158 data ['metrics' ]['metric_one' ]['extra_args' ] = {
155159 'aggregation_method' : 'max' ,
156160 'query_function' : 'abs' ,
161+ 'query_prefix' : 'custom_prefix' ,
162+ 'query_suffix' : 'custom_suffix' ,
157163 'range_function' : 'delta' ,
158164 }
159165 expected_output = copy .deepcopy (self .base_output )
160166 expected_output ['metric_one' ]['groupby' ].append ('project_id' )
161167 expected_output ['metric_one' ]['extra_args' ] = {
162168 'aggregation_method' : 'max' ,
163169 'query_function' : 'abs' ,
170+ 'query_prefix' : 'custom_prefix' ,
171+ 'query_suffix' : 'custom_suffix' ,
164172 'range_function' : 'delta' ,
165173 }
166174
0 commit comments