|
6 | 6 | a URL for its storage. |
7 | 7 | """ |
8 | 8 |
|
9 | | -import datetime |
10 | 9 | import io |
11 | 10 | import uuid |
12 | | -from http import HTTPStatus |
13 | 11 | from urllib.parse import urlsplit, urlunsplit |
14 | 12 |
|
15 | 13 | import pytest |
16 | 14 | import requests |
17 | | -from beartype import BeartypeConf, beartype |
18 | | -from freezegun import freeze_time |
19 | 15 |
|
20 | | -from mock_vws import MockVWS |
21 | 16 | from mock_vws.database import CloudDatabase |
22 | 17 | from tests.mock_vws.reco_counts_report.helpers import ( |
23 | 18 | CSV_HEADER, |
@@ -183,43 +178,3 @@ def test_counts_set_after_first_request( |
183 | 178 | # new file, and nothing is claimed about that. |
184 | 179 | same_file = urlsplit(url=first_url).path == urlsplit(url=second_url).path |
185 | 180 | assert not same_file or ready_response.text == CSV_HEADER |
186 | | - |
187 | | - |
188 | | -@pytest.mark.parametrize( |
189 | | - argnames="processing_time_seconds", |
190 | | - argvalues=[ |
191 | | - pytest.param(60, id="integer"), |
192 | | - pytest.param(60.0, id="float"), |
193 | | - pytest.param(0.5, id="fractional"), |
194 | | - ], |
195 | | -) |
196 | | -@beartype(conf=BeartypeConf(is_pep484_tower=True)) |
197 | | -def test_report_processing_time( |
198 | | - *, base_vws_url: str, processing_time_seconds: float |
199 | | -) -> None: |
200 | | - """Integer and float delays make reports ready at their completion |
201 | | - time. |
202 | | - """ |
203 | | - database = CloudDatabase() |
204 | | - with ( |
205 | | - freeze_time(time_to_freeze="2026-10-13 12:00:00") as frozen_time, |
206 | | - MockVWS( |
207 | | - base_vws_url=base_vws_url, |
208 | | - processing_time_seconds=processing_time_seconds, |
209 | | - ) as mock, |
210 | | - ): |
211 | | - mock.add_cloud_database(cloud_database=database) |
212 | | - presigned_url = get_presigned_url( |
213 | | - base_vws_url=base_vws_url, |
214 | | - vuforia_database=database, |
215 | | - month=month_offset_from_now(months=0), |
216 | | - ) |
217 | | - response = requests.get(url=presigned_url, timeout=30) |
218 | | - assert_not_ready(response=response, key=report_key(url=presigned_url)) |
219 | | - |
220 | | - _ = frozen_time.tick( |
221 | | - delta=datetime.timedelta(seconds=processing_time_seconds), |
222 | | - ) |
223 | | - response = requests.get(url=presigned_url, timeout=30) |
224 | | - assert response.status_code == HTTPStatus.OK |
225 | | - assert response.text == CSV_HEADER |
0 commit comments