node-deadline
Version:
Module to interface with Deadline Compute Management System by Thinkbox Software
37 lines (23 loc) • 1.46 kB
Markdown
#Deadline.test
This class is used to test module functionality without creating real connections to a deadline database.
When the Deadline module is initialized with the test flag, all internal requests are re-routed to this module.
With no intervention, returning empty document sets for all results. In verbose mode, this module will log
all connections and queries
##Deadline.test.init( options )
Initializes the test framework, must be called BEFORE attempting to get any information from deadline.
Takes an optional options object with connection information for the test server. With no specified
options, the test class accepts all mongo connection attempts ( *default without initialization* ).
####Options
- **host:** the host name or ip of allowed connections
- **port:** the conenction port of allowed connections
- **username:** username to require on connections
- **password:** password to require on connections
##Deadline.test.onRequest( database, collection, query, callback )
This function can be overwritten, and initially only calls the callback with no errors but
an empty result list (via Deadline.test.emptySuccess)
##Deadline.test.emptySuccess( callback )
Simply calls the provided callback with no error but also no results
##Deadline.test.find( database, collection, query, callback )
Runs the given query through onRequest
##Deadline.test.connectTo( databse, collection, callback )
Validates current connection properties