Skip to content

Commit 848aaa7

Browse files
Merge pull request #88 from adamtheturtle/target-list
Return results in target list
2 parents 14a0d20 + c15d31e commit 848aaa7

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

pylintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ confidence=
6969
disable=line-too-long,
7070
too-few-public-methods,
7171
locally-disabled,
72+
# Let flake8 handle unused imports
73+
unused-import,
7274

7375
[REPORTS]
7476

src/mock_vws/_mock.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import json
66
import uuid
77
from datetime import datetime, timedelta
8+
from typing import Union # noqa F401
89
from typing import Callable, Dict, List, Tuple
910

1011
import wrapt
@@ -192,11 +193,12 @@ def target_list(self,
192193
Fake implementation of
193194
https://library.vuforia.com/articles/Solution/How-To-Get-a-Target-List-for-a-Cloud-Database-Using-the-VWS-API
194195
"""
195-
body = {} # type: Dict[str, str]
196+
body = {} # type: Dict[str, Union[str, List[object]]]
196197

197198
context.status_code = codes.OK # pylint: disable=no-member
198199
body = {
199200
'transaction_id': uuid.uuid4().hex,
200201
'result_code': ResultCodes.SUCCESS.value,
202+
'results': [],
201203
}
202204
return json.dumps(body)

tests/mock_vws/test_target_list.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ def test_success(self,
4545
data=b'',
4646
)
4747
assert response.status_code == codes.OK
48+
expected_keys = {'result_code', 'transaction_id', 'results'}
49+
assert response.json().keys() == expected_keys
50+
assert response.json()['results'] == []

0 commit comments

Comments
 (0)