77import io
88import secrets
99import uuid
10+ from typing import BinaryIO
1011
1112import pytest
1213from freezegun import freeze_time
@@ -33,7 +34,7 @@ class TestAddTarget:
3334 @pytest .mark .parametrize ("active_flag" , [True , False ])
3435 def test_add_target (
3536 vws_client : VWS ,
36- image : io .BytesIO | io . BufferedRandom ,
37+ image : io .BytesIO | BinaryIO ,
3738 application_metadata : bytes | None ,
3839 cloud_reco_client : CloudRecoService ,
3940 * ,
@@ -77,7 +78,7 @@ def test_add_target(
7778 @staticmethod
7879 def test_add_two_targets (
7980 vws_client : VWS ,
80- image : io .BytesIO | io . BufferedRandom ,
81+ image : io .BytesIO | BinaryIO ,
8182 ) -> None :
8283 """
8384 No exception is raised when adding two targets with different names.
@@ -100,7 +101,7 @@ class TestCustomBaseVWSURL:
100101 """
101102
102103 @staticmethod
103- def test_custom_base_url (image : io .BytesIO | io . BufferedRandom ) -> None :
104+ def test_custom_base_url (image : io .BytesIO | BinaryIO ) -> None :
104105 """
105106 It is possible to use add a target to a database under a custom VWS
106107 URL.
@@ -132,7 +133,7 @@ class TestListTargets:
132133 @staticmethod
133134 def test_list_targets (
134135 vws_client : VWS ,
135- image : io .BytesIO | io . BufferedRandom ,
136+ image : io .BytesIO | BinaryIO ,
136137 ) -> None :
137138 """
138139 It is possible to get a list of target IDs.
@@ -162,7 +163,7 @@ class TestDelete:
162163 @staticmethod
163164 def test_delete_target (
164165 vws_client : VWS ,
165- image : io .BytesIO | io . BufferedRandom ,
166+ image : io .BytesIO | BinaryIO ,
166167 ) -> None :
167168 """
168169 It is possible to delete a target.
@@ -189,7 +190,7 @@ class TestGetTargetSummaryReport:
189190 @staticmethod
190191 def test_get_target_summary_report (
191192 vws_client : VWS ,
192- image : io .BytesIO | io . BufferedRandom ,
193+ image : io .BytesIO | BinaryIO ,
193194 ) -> None :
194195 """
195196 Details of a target are returned by ``get_target_summary_report``.
@@ -258,7 +259,7 @@ class TestGetTargetRecord:
258259 @staticmethod
259260 def test_get_target_record (
260261 vws_client : VWS ,
261- image : io .BytesIO | io . BufferedRandom ,
262+ image : io .BytesIO | BinaryIO ,
262263 ) -> None :
263264 """
264265 Details of a target are returned by ``get_target_record``.
@@ -293,7 +294,7 @@ class TestWaitForTargetProcessed:
293294 @staticmethod
294295 def test_wait_for_target_processed (
295296 vws_client : VWS ,
296- image : io .BytesIO | io . BufferedRandom ,
297+ image : io .BytesIO | BinaryIO ,
297298 ) -> None :
298299 """
299300 It is possible to wait until a target is processed.
@@ -313,7 +314,7 @@ def test_wait_for_target_processed(
313314
314315 @staticmethod
315316 def test_default_seconds_between_requests (
316- image : io .BytesIO | io . BufferedRandom ,
317+ image : io .BytesIO | BinaryIO ,
317318 ) -> None :
318319 """
319320 By default, 0.2 seconds are waited between polling requests.
@@ -365,7 +366,7 @@ def test_default_seconds_between_requests(
365366
366367 @staticmethod
367368 def test_custom_seconds_between_requests (
368- image : io .BytesIO | io . BufferedRandom ,
369+ image : io .BytesIO | BinaryIO ,
369370 ) -> None :
370371 """
371372 It is possible to customize the time waited between polling requests.
@@ -416,7 +417,7 @@ def test_custom_seconds_between_requests(
416417 assert report .request_usage == expected_requests
417418
418419 @staticmethod
419- def test_custom_timeout (image : io .BytesIO | io . BufferedRandom ) -> None :
420+ def test_custom_timeout (image : io .BytesIO | BinaryIO ) -> None :
420421 """
421422 It is possible to set a maximum timeout.
422423 """
@@ -460,7 +461,7 @@ class TestGetDuplicateTargets:
460461 @staticmethod
461462 def test_get_duplicate_targets (
462463 vws_client : VWS ,
463- image : io .BytesIO | io . BufferedRandom ,
464+ image : io .BytesIO | BinaryIO ,
464465 ) -> None :
465466 """
466467 It is possible to get the IDs of similar targets.
@@ -494,8 +495,8 @@ class TestUpdateTarget:
494495 @staticmethod
495496 def test_update_target (
496497 vws_client : VWS ,
497- image : io .BytesIO | io . BufferedRandom ,
498- different_high_quality_image : io .BytesIO | io . BufferedRandom ,
498+ image : io .BytesIO | BinaryIO ,
499+ different_high_quality_image : io .BytesIO ,
499500 cloud_reco_client : CloudRecoService ,
500501 ) -> None :
501502 """
@@ -553,7 +554,7 @@ def test_update_target(
553554 @staticmethod
554555 def test_no_fields_given (
555556 vws_client : VWS ,
556- image : io .BytesIO | io . BufferedRandom ,
557+ image : io .BytesIO | BinaryIO ,
557558 ) -> None :
558559 """
559560 It is possible to give no update fields.
0 commit comments