def testResult(self):
     queryId = "257928e9-73a3-4422-bf20-2d0f80bf2a12"
     r = ResultHandler(queryId)
     res = r.getQuery()
     # convert string to dic
     res = simplejson.loads(res)
     self.assertEqual(res["status"], "done")
     self.assertEqual(res["start_local_time"], "Fri Apr  4 15:59:25 2014")
     self.assertEqual(res["instrument_name"], "D20")
def results(queryId):
    """
    Return the contents of localDataStorage has json
    
    Test:
    curl -X POST  http://localhost:8080/results/<queryId>
    """
            
    r = ResultHandler(queryId)
    message = r.getQuery()
    logger.debug(message)
    return message
def resultszipped(queryId):
    """
    Return the contents of localDataStorage has json
    
    Test:
    curl -X POST  http://localhost:8080/resultszipped/<queryId>
    """
            
    r = ResultHandler(queryId)
    message = r.getQueryZipped()
    logger.debug("Zipped content! size = %d"%len(message))
    bottle.response.set_header('Content-Encoding', 'gzip')
    return message