Skip to content

Commit 7ca686b

Browse files
committed
Remove unused utility [skip ci]
1 parent 9491a28 commit 7ca686b

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

tests/mock_vws/utils/assertions.py

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
import email.utils
77
import json
88
from string import hexdigits
9-
from typing import Any, Dict, Optional
10-
from urllib.parse import urljoin
9+
from typing import Optional
1110

1211
import pytz
13-
import requests
1412
from requests import Response, codes
15-
from requests_mock import POST
1613

1714
from mock_vws._constants import ResultCodes
1815
from tests.mock_vws.utils.authorization import (
@@ -153,53 +150,6 @@ def assert_vws_response(
153150
assert_valid_date_header(response=response)
154151

155152

156-
def add_target_to_vws(
157-
vuforia_database_keys: VuforiaDatabaseKeys,
158-
data: Dict[str, Any],
159-
content_type: str = 'application/json',
160-
) -> Response:
161-
"""
162-
Return a response from a request to the endpoint to add a target.
163-
164-
Args:
165-
vuforia_database_keys: The credentials to use to connect to Vuforia.
166-
data: The data to send, in JSON format, to the endpoint.
167-
content_type: The `Content-Type` header to use.
168-
169-
Returns:
170-
The response returned by the API.
171-
"""
172-
date = rfc_1123_date()
173-
request_path = '/targets'
174-
175-
content = bytes(json.dumps(data), encoding='utf-8')
176-
177-
authorization_string = authorization_header(
178-
access_key=vuforia_database_keys.server_access_key,
179-
secret_key=vuforia_database_keys.server_secret_key,
180-
method=POST,
181-
content=content,
182-
content_type=content_type,
183-
date=date,
184-
request_path=request_path,
185-
)
186-
187-
headers = {
188-
'Authorization': authorization_string,
189-
'Date': date,
190-
'Content-Type': content_type,
191-
}
192-
193-
response = requests.request(
194-
method=POST,
195-
url=urljoin(base='https://vws.vuforia.com/', url=request_path),
196-
headers=headers,
197-
data=content,
198-
)
199-
200-
return response
201-
202-
203153
def assert_query_success(response: Response) -> None:
204154
"""
205155
Assert that the given response is a success response for performing an

0 commit comments

Comments
 (0)