File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -201,3 +201,9 @@ def response(self) -> Response:
201201 The response returned by Vuforia which included this error.
202202 """
203203 return self ._response
204+
205+
206+ class TargetProcessingTimeout (Exception ):
207+ """
208+ Exception raised when waiting for a target to be processed times out.
209+ """
Original file line number Diff line number Diff line change 2222 MetadataTooLarge ,
2323 ProjectInactive ,
2424 TargetNameExist ,
25+ TargetProcessingTimeout ,
2526 TargetStatusProcessing ,
2627 UnknownTarget ,
2728)
@@ -337,7 +338,10 @@ def wait_for_target_processed(
337338 target in the database.
338339 """
339340
340- @timeout (seconds = timeout_seconds )
341+ @timeout (
342+ seconds = timeout_seconds ,
343+ timeout_exception = TargetProcessingTimeout ,
344+ )
341345 def decorated () -> None :
342346 self ._wait_for_target_processed (
343347 target_id = target_id ,
Original file line number Diff line number Diff line change 66from typing import Optional
77
88import pytest
9- import timeout_decorator
109from mock_vws import MockVWS
1110from mock_vws .database import VuforiaDatabase
1211
1312from vws import VWS
14- from vws .exceptions import UnknownTarget
13+ from vws .exceptions import TargetProcessingTimeout , UnknownTarget
1514
1615
1716class TestAddTarget :
@@ -388,7 +387,7 @@ def test_custom_timeout(
388387
389388 report = client .get_target_summary_report (target_id = target_id )
390389 assert report ['status' ] == 'processing'
391- with pytest .raises (timeout_decorator . TimeoutError ):
390+ with pytest .raises (TargetProcessingTimeout ):
392391 client .wait_for_target_processed (
393392 target_id = target_id ,
394393 timeout_seconds = 0.1 ,
You can’t perform that action at this time.
0 commit comments