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 OutcomeClient, 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]
  ApiKeyAuth
An authorization method that uses an api key.
  _BaseClient
Base client class providing some reasonable defaults.
  TestClient
Interact with the Test server.
  OutcomeClient
Client side access to Results of STU tests.
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, overwrite=False)
 
report(local_system, remote_system, executor, tests, build_log_address=None, build_results_dir=None, comments='', total_time=None)
Report the results of tests to the server.
 
_verb_wrapper(method)
Wrap the requested in http verb in a message if the server is not available.
 
_more_verbose_errors(method)
If response has a bad status, raise an Exception.
 
check_status(self, required_status)
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.
  __package__ = 'schrodinger.test.stu'
Function Details [hide private]

report(local_system, remote_system, executor, tests, build_log_address=None, build_results_dir=None, comments='', total_time=None)

 

Report the results of tests to the server.

Parameters:
  • executor (str) - Username of the user who executed the tests.
  • tests (iterable) - List of Test objects.
  • build_log_address (str) - Full path to BuildBot log file.
  • build_results_dir (str) - Full path where the results will be stored long-term
  • comments (str) - Comments about this run
  • total_time (float) - Total time since start of the STU process.
  • local_system (sysinfo._SysInfo)
  • remote_system (sysinfo._SysInfo)

_more_verbose_errors(method)

 

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(self, required_status)

 

Raise an error if the status does not match required_status.

Parameters:
  • required_status (int) - Status to match