def query(): ''' Get the query results. Sent json by the client should be of the form: { "method" : "theta_vs_counts", "params" : { "numors":[94460]} } ''' content = bottle.request.body.read() logger.debug("RAW Query received: " + str(content)) qh = QueryHandler(content) message = qh.process() logger.debug(message) return message
def testHandlerInvalidJson(self): content = self.invalidJson qh = QueryHandler(content) message = qh.process() self.assertDictContainsSubset({'success' : 'False'}, message)
def testHandlerValid(self): content = self.validJson qh = QueryHandler(content) message = qh.process() print message self.assertDictContainsSubset({'timeout' : 30}, message)