Package schrodinger :: Package test :: Package stu :: Module client
[hide private]
[frames] | no frames]

Module client

Client for communication with STU server. The core functionality is in TestClient and ResultReporter, but most is accessible from the module level convenience functions create, retrieve, update, delete, and download, which allow modification of the tests in the database.


Copyright: (c) Schrodinger, LLC. All rights reserved.

Classes [hide private]
  ClientError
Generic STU client error.
  ClientValueError
Arguments to a client function are incorrect, or not fully determined.
  ResultReporter
Reporter that will upload results and files for a specific test run.
  ApiKeyAuth
An authorization method that uses an api key.
  _BaseClient
Base client class providing some reasonable defaults.
  TestClient
Interact with the Test server.
Functions [hide private]
 
create(username, test, directory=None, upload=True)
 
retrieve(username, *args, **kwargs)
 
update(username, test, directory=None, upload=True)
 
delete(username, test)
 
download(username, test, directory=None, overwrite=True)
 
raise_for_status(response)
If response has a bad status, raise an Exception.
 
check_status(response, required_statuses)
Raise an error if the status does not match required_status.
Variables [hide private]
  logger = log.get_logger('test_backend')
  _VERSION = 1
API version to use.
  _JSON_FORMAT = {'content-type': 'application/json'}
Function Details [hide private]

raise_for_status(response)

 

If response has a bad status, raise an Exception. First, however, be sure to print any data available from the exception.

Parameters:
  • response (requests.models.Response) - Response to check for exit status problems.

check_status(response, required_statuses)

 

Raise an error if the status does not match required_status.

Parameters:
  • required_status (int) - Status to match