Skip to content

Commit 8306c32

Browse files
committed
Start of tests for inactive project
1 parent 8ab0c1b commit 8306c32

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

tests/mock_vws/conftest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,20 @@ def endpoint(request: SubRequest) -> Endpoint:
206206
"""
207207
endpoint_fixture: Endpoint = request.getfixturevalue(request.param)
208208
return endpoint_fixture
209+
210+
211+
@pytest.fixture(
212+
params=[
213+
'_add_target',
214+
'_database_summary',
215+
'_target_list',
216+
'_query',
217+
],
218+
)
219+
def endpoint_success_no_target_id(request: SubRequest) -> Endpoint:
220+
"""
221+
Return details of an endpoint for the Target API or the Query API which
222+
does not require a target ID for success.
223+
"""
224+
endpoint_fixture: Endpoint = request.getfixturevalue(request.param)
225+
return endpoint_fixture

tests/mock_vws/test_inactive_project.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,27 @@ class TestInactiveProject:
3636
def test_inactive_project(
3737
self,
3838
inactive_database_keys: VuforiaDatabaseKeys,
39-
endpoint: Endpoint,
39+
vuforia_database_keys: VuforiaDatabaseKeys,
40+
endpoint_success_no_target_id: Endpoint,
4041
) -> None:
4142
"""
4243
The project's active state does not affect the database summary.
4344
"""
45+
endpoint = endpoint_success_no_target_id
4446
endpoint_headers = dict(endpoint.prepared_request.headers)
4547
content = endpoint.prepared_request.body or b''
48+
if 'query' in endpoint.prepared_request.url:
49+
# TODO fix this up for query
50+
return
4651
assert isinstance(content, bytes)
4752
date = rfc_1123_date()
4853

54+
keys = inactive_database_keys
55+
# keys = vuforia_database_keys
56+
4957
authorization_string = authorization_header(
50-
access_key=endpoint.access_key,
51-
secret_key=endpoint.secret_key,
58+
access_key=keys.server_access_key,
59+
secret_key=keys.server_secret_key,
5260
method=str(endpoint.prepared_request.method),
5361
content=content,
5462
content_type=endpoint.auth_header_content_type,

0 commit comments

Comments
 (0)