File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""
22Custom exceptions for Vuforia errors.
33"""
4+
5+ import json
46from urllib .parse import urlparse
57
68import requests
@@ -285,6 +287,15 @@ def response(self) -> Response:
285287 """
286288 return self ._response
287289
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+
288299
289300class ImageTooLarge (Exception ):
290301 """
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ def test_target_name_exist(
149149 )
150150
151151 assert exc .value .response .status_code == codes .FORBIDDEN
152+ assert exc .value .target_name == 'x'
152153
153154
154155def test_project_inactive (
You can’t perform that action at this time.
0 commit comments