Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
 def testHandlerInvalidJson(self):
     content = self.invalidJson
     qh = QueryHandler(content)
     message = qh.process()
     self.assertDictContainsSubset({'success' : 'False'}, message)
Ejemplo n.º 3
0
 def testHandlerValid(self):
     content = self.validJson
     qh = QueryHandler(content)
     message = qh.process()
     print message
     self.assertDictContainsSubset({'timeout' : 30}, message)