File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
Custom exceptions for Vuforia errors.
3
3
"""
4
+
5
+ import json
4
6
from urllib .parse import urlparse
5
7
6
8
import requests
@@ -285,6 +287,15 @@ def response(self) -> Response:
285
287
"""
286
288
return self ._response
287
289
290
+ @property
291
+ def target_name (self ) -> str :
292
+ """
293
+ The target name which already exists.
294
+ """
295
+ response_body = self .response .request .body or b''
296
+ request_json = json .loads (response_body )
297
+ return str (request_json ['name' ])
298
+
288
299
289
300
class ImageTooLarge (Exception ):
290
301
"""
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ def test_target_name_exist(
149
149
)
150
150
151
151
assert exc .value .response .status_code == codes .FORBIDDEN
152
+ assert exc .value .target_name == 'x'
152
153
153
154
154
155
def test_project_inactive (
You can’t perform that action at this time.
0 commit comments