Skip to content

Commit ea8d0a7

Browse files
Merge pull request #201 from adamtheturtle/more-hints
Add type hints for various classes
2 parents 0e0ee5f + eb4bfe6 commit ea8d0a7

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

src/mock_vws/_mock_common.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class Route:
3535
later.
3636
"""
3737

38+
route_name: str
39+
path_pattern: str
40+
http_methods: List[str]
41+
3842
def __init__(
3943
self,
4044
route_name: str,

src/mock_vws/database.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ class VuforiaDatabase:
1414
Credentials for VWS APIs.
1515
"""
1616

17+
database_name: str
18+
server_access_key: bytes
19+
server_secret_key: bytes
20+
client_access_key: bytes
21+
client_secret_key: bytes
22+
targets: List[Target]
23+
state: States
24+
1725
def __init__(
1826
self,
1927
server_access_key: Optional[str] = None,

src/mock_vws/target.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ class Target: # pylint: disable=too-many-instance-attributes
2121
https://developer.vuforia.com/target-manager.
2222
"""
2323

24+
name: str
25+
target_id: str
26+
active_flag: bool
27+
width: float
28+
upload_date: datetime.datetime
29+
last_modified_date: datetime.datetime
30+
processed_tracking_rating: int
31+
image: io.BytesIO
32+
reco_rating: str
33+
application_metadata: str
34+
delete_date: Optional[datetime.datetime]
35+
2436
def __init__( # pylint: disable=too-many-arguments
2537
self,
2638
name: str,
@@ -46,7 +58,7 @@ def __init__( # pylint: disable=too-many-arguments
4658
name (str): The name of the target.
4759
target_id (str): The unique ID of the target.
4860
active_flag (bool): Whether or not the target is active for query.
49-
width (int): The width of the image in scene unit.
61+
width (float): The width of the image in scene unit.
5062
upload_date (datetime.datetime): The time that the target was
5163
created.
5264
last_modified_date (datetime.datetime): The time that the target

tests/mock_vws/utils/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ class Endpoint:
2929
Details of endpoints to be called in tests.
3030
"""
3131

32+
prepared_request: requests.PreparedRequest
33+
successful_headers_result_code: ResultCodes
34+
successful_headers_status_code: int
35+
auth_header_content_type: str
36+
access_key: bytes
37+
secret_key: bytes
38+
3239
def __init__(
3340
self,
3441
prepared_request: requests.PreparedRequest,

0 commit comments

Comments
 (0)