File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -233,3 +233,21 @@ def get_target_summary_report(
233233 )
234234
235235 return dict (response .json ())
236+
237+ def get_database_summary_report (self ) -> Dict [str , Union [str , int ]]:
238+ """
239+ Get a summary report for the database.
240+
241+ Returns:
242+ Details of the database.
243+ """
244+ response = _target_api_request (
245+ server_access_key = self ._server_access_key ,
246+ server_secret_key = self ._server_secret_key ,
247+ method = 'GET' ,
248+ content = b'' ,
249+ request_path = '/summary' ,
250+ base_vws_url = self ._base_vws_url ,
251+ )
252+
253+ return dict (response .json ())
Original file line number Diff line number Diff line change 1+ """
2+ Tests for helper function for getting a summary report for a Vuforia database.
3+ """
4+
5+ from vws import VWS
6+
7+
8+ class TestGetDatabaseSummaryReport :
9+ """
10+ Tests for getting a summary report for a database.
11+ """
12+
13+ def test_get_target (self , client : VWS ) -> None :
14+ """
15+ Details of a database are returned by ``get_database_summary_report``.
16+ """
17+ report = client .get_database_summary_report ()
18+ expected_keys = {
19+ 'active_images' ,
20+ 'current_month_recos' ,
21+ 'failed_images' ,
22+ 'inactive_images' ,
23+ 'name' ,
24+ 'previous_month_recos' ,
25+ 'processing_images' ,
26+ 'reco_threshold' ,
27+ 'request_quota' ,
28+ 'request_usage' ,
29+ 'result_code' ,
30+ 'target_quota' ,
31+ 'total_recos' ,
32+ 'transaction_id' ,
33+ }
34+ assert report .keys () == expected_keys
You can’t perform that action at this time.
0 commit comments