File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed
Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 33"""
44
55from .vws import VWS
6+ from .query import CloudRecoService
67
78__all__ = [
9+ 'CloudRecoService' ,
810 'VWS' ,
911]
1012
Original file line number Diff line number Diff line change 1+ import io
2+
3+ class CloudRecoService :
4+ """
5+ An interface to Vuforia Web Services APIs.
6+ """
7+
8+ def __init__ (
9+ self ,
10+ client_access_key : str ,
11+ client_secret_key : str ,
12+ base_vws_url : str = 'https://vws.vuforia.com' ,
13+ ) -> None :
14+ """
15+ Args:
16+ client_access_key: A VWS client access key.
17+ client_secret_key: A VWS client secret key.
18+ base_vws_url: The base URL for the VWS API.
19+ """
20+ self ._client_access_key = client_access_key .encode ()
21+ self ._client_secret_key = client_secret_key .encode ()
22+ self ._base_vws_url = base_vws_url
23+
24+ def query (
25+ self ,
26+ image : io .BytesIO ,
27+ ) -> str :
28+ """
29+ Add a target to a Vuforia Web Services database.
30+
31+ """
Original file line number Diff line number Diff line change 1+ """
2+ Tests for helper functions for managing a Vuforia database.
3+ """
4+
5+ import io
6+ from typing import Optional
7+
8+ import pytest
9+ from mock_vws import MockVWS
10+ from mock_vws .database import VuforiaDatabase
11+
12+ from vws import CloudRecoService , VWS
13+ from vws .exceptions import TargetProcessingTimeout
14+
15+
16+ class TestQuery :
17+ """
18+ Tests for adding a target.
19+ """
20+
21+ def test_query (
22+ self ,
23+ client : VWS ,
24+ high_quality_image : io .BytesIO ,
25+ ) -> None :
26+ """
27+ No exception is raised when adding one target.
28+ """
29+ cloud_reco_client = CloudRecoService (
30+ client_access_key = 'foo' ,
31+ client_secret_key = 'bar' ,
32+ )
33+ cloud_reco_client .query (image = high_quality_image )
34+
35+ # TODO test custom base URL
You can’t perform that action at this time.
0 commit comments