Skip to content

Commit 05c2dcb

Browse files
Fix tests
1 parent bec95e5 commit 05c2dcb

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

tests/test_clickhouse_service.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ def test_query_processed_latency_success(self, clickhouse_service, mock_clickhou
263263
start_time=start_time,
264264
end_time=end_time,
265265
cell_index=1,
266+
window_duration_seconds=10,
266267
offset=0,
267268
limit=100
268269
)
@@ -292,6 +293,7 @@ def test_query_processed_latency_empty_result(self, clickhouse_service, mock_cli
292293
start_time=start_time,
293294
end_time=end_time,
294295
cell_index=1,
296+
window_duration_seconds=10,
295297
offset=0,
296298
limit=100
297299
)
@@ -311,6 +313,7 @@ def test_query_processed_latency_with_pagination(self, clickhouse_service, mock_
311313
start_time=start_time,
312314
end_time=end_time,
313315
cell_index=1,
316+
window_duration_seconds=10,
314317
offset=50,
315318
limit=25
316319
)
@@ -346,6 +349,7 @@ def test_query_processed_latency_multiple_rows(self, clickhouse_service, mock_cl
346349
start_time=start_time,
347350
end_time=end_time,
348351
cell_index=1,
352+
window_duration_seconds=10,
349353
offset=0,
350354
limit=100
351355
)
@@ -380,6 +384,7 @@ def test_query_processed_latency_with_nullable_fields(self, clickhouse_service,
380384
start_time=start_time,
381385
end_time=end_time,
382386
cell_index=1,
387+
window_duration_seconds=10,
383388
offset=0,
384389
limit=100
385390
)

tests/test_latency_endpoint.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def test_get_processed_latency_success(self, test_client, mock_clickhouse_servic
8080
params={
8181
"start_time": SAMPLE_START_TIME,
8282
"end_time": SAMPLE_END_TIME,
83-
"cell_index": 1
83+
"cell_index": 1,
84+
"window_duration_seconds":300
8485
}
8586
)
8687

@@ -105,7 +106,8 @@ def test_get_processed_latency_empty_result(self, test_client, mock_clickhouse_s
105106
params={
106107
"start_time": SAMPLE_START_TIME,
107108
"end_time": SAMPLE_END_TIME,
108-
"cell_index": 1
109+
"cell_index": 1,
110+
"window_duration_seconds":300
109111
}
110112
)
111113

@@ -120,6 +122,7 @@ def test_get_processed_latency_missing_required_params(self, test_client, mock_c
120122
params={
121123
"start_time": SAMPLE_START_TIME,
122124
"end_time": SAMPLE_END_TIME
125+
123126
}
124127
)
125128

@@ -136,7 +139,8 @@ def test_get_processed_latency_with_pagination(self, test_client, mock_clickhous
136139
"end_time": SAMPLE_END_TIME,
137140
"cell_index": 1,
138141
"offset": 50,
139-
"limit": 25
142+
"limit": 25,
143+
"window_duration_seconds":300
140144
}
141145
)
142146

@@ -155,7 +159,8 @@ def test_get_processed_latency_invalid_limit(self, test_client, mock_clickhouse_
155159
"start_time": SAMPLE_START_TIME,
156160
"end_time": SAMPLE_END_TIME,
157161
"cell_index": 1,
158-
"limit": 5000 # Exceeds max of 1000
162+
"limit": 5000, # Exceeds max of 1000
163+
"window_duration_seconds":300
159164
}
160165
)
161166

@@ -169,7 +174,8 @@ def test_get_processed_latency_invalid_offset(self, test_client, mock_clickhouse
169174
"start_time": SAMPLE_START_TIME,
170175
"end_time": SAMPLE_END_TIME,
171176
"cell_index": 1,
172-
"offset": -10
177+
"offset": -10,
178+
"window_duration_seconds":300
173179
}
174180
)
175181

@@ -184,7 +190,8 @@ def test_get_processed_latency_service_error(self, test_client, mock_clickhouse_
184190
params={
185191
"start_time": SAMPLE_START_TIME,
186192
"end_time": SAMPLE_END_TIME,
187-
"cell_index": 1
193+
"cell_index": 1,
194+
"window_duration_seconds":300
188195
}
189196
)
190197

@@ -202,7 +209,8 @@ def test_get_processed_latency_multiple_results(self, test_client, mock_clickhou
202209
params={
203210
"start_time": SAMPLE_START_TIME,
204211
"end_time": SAMPLE_END_TIME,
205-
"cell_index": 1
212+
"cell_index": 1,
213+
"window_duration_seconds":300
206214
}
207215
)
208216

@@ -219,7 +227,8 @@ def test_get_processed_latency_default_pagination(self, test_client, mock_clickh
219227
params={
220228
"start_time": SAMPLE_START_TIME,
221229
"end_time": SAMPLE_END_TIME,
222-
"cell_index": 1
230+
"cell_index": 1,
231+
"window_duration_seconds":300
223232
}
224233
)
225234

@@ -252,7 +261,8 @@ def test_get_processed_latency_with_null_fields(self, test_client, mock_clickhou
252261
params={
253262
"start_time": SAMPLE_START_TIME,
254263
"end_time": SAMPLE_END_TIME,
255-
"cell_index": 1
264+
"cell_index": 1,
265+
"window_duration_seconds":300
256266
}
257267
)
258268

@@ -268,7 +278,8 @@ def test_get_processed_latency_invalid_datetime_format(self, test_client, mock_c
268278
params={
269279
"start_time": "invalid-timestamp",
270280
"end_time": SAMPLE_END_TIME,
271-
"cell_index": 1
281+
"cell_index": 1,
282+
"window_duration_seconds":300
272283
}
273284
)
274285

0 commit comments

Comments
 (0)