|
3 | 3 | import io |
4 | 4 | import uuid |
5 | 5 |
|
| 6 | +import pytest |
6 | 7 | from vws import VWS |
7 | 8 |
|
8 | | -from mock_vws import MockVWS |
9 | | -from mock_vws.database import CloudDatabase |
10 | 9 | from tests.mock_vws.database_summary.helpers import ( |
11 | 10 | wait_for_image_numbers, |
12 | 11 | ) |
13 | 12 |
|
14 | 13 |
|
| 14 | +@pytest.mark.usefixtures("mock_only_vuforia") |
15 | 15 | def test_processing_images( |
| 16 | + *, |
| 17 | + vws_client: VWS, |
16 | 18 | image_file_success_state_low_rating: io.BytesIO, |
17 | 19 | ) -> None: |
18 | 20 | """The number of images in the processing state is returned. |
19 | 21 |
|
20 | | - These tests are run only on the mock, and not the real |
21 | | - implementation. |
22 | | -
|
23 | | - This is because the real implementation is not reliable. This is a |
24 | | - documented difference between the mock and the real implementation. |
| 22 | + The mock adapters report processing images immediately. Real Vuforia's |
| 23 | + summaries are not reliable while targets are processing. |
25 | 24 | """ |
26 | | - database = CloudDatabase() |
27 | | - vws_client = VWS( |
28 | | - server_access_key=database.server_access_key, |
29 | | - server_secret_key=database.server_secret_key, |
| 25 | + _ = vws_client.add_target( |
| 26 | + name=uuid.uuid4().hex, |
| 27 | + width=1, |
| 28 | + image=image_file_success_state_low_rating, |
| 29 | + active_flag=True, |
| 30 | + application_metadata=None, |
30 | 31 | ) |
31 | 32 |
|
32 | | - with MockVWS() as mock: |
33 | | - mock.add_cloud_database(cloud_database=database) |
34 | | - _ = vws_client.add_target( |
35 | | - name=uuid.uuid4().hex, |
36 | | - width=1, |
37 | | - image=image_file_success_state_low_rating, |
38 | | - active_flag=True, |
39 | | - application_metadata=None, |
40 | | - ) |
41 | | - |
42 | | - wait_for_image_numbers( |
43 | | - vws_client=vws_client, |
44 | | - active_images=0, |
45 | | - inactive_images=0, |
46 | | - failed_images=0, |
47 | | - processing_images=1, |
48 | | - ) |
| 33 | + wait_for_image_numbers( |
| 34 | + vws_client=vws_client, |
| 35 | + active_images=0, |
| 36 | + inactive_images=0, |
| 37 | + failed_images=0, |
| 38 | + processing_images=1, |
| 39 | + ) |
0 commit comments