Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_dispatch_query(self, mock_get, mock_loader):
mock_get.return_value = self.setMockGetResponse()
mock_loader.return_value = self.loader
resp, status, headers = utils.dispatch_query(None, None, 'test-projection', requestArgs={'id': 'http://dbpedia.org/resource/Frida_Kahlo'})
self.validateTestResponse(resp)
self.assertNotEqual(status, 404)
def query(user, repo, query_name, sha=None, content=None):
glogger.info("-----> Executing call name at /{}/{}/{} on commit {}".format(user, repo, query_name, sha))
glogger.debug("Request accept header: " + request.headers["Accept"])
requestArgs = request.args
acceptHeader = request.headers['Accept']
requestUrl = request.url
formData = request.form
query_response, status, headers = utils.dispatch_query(user, repo, query_name,
sha=sha, content=content, requestArgs=requestArgs,
acceptHeader=acceptHeader,
requestUrl=requestUrl, formData=formData)
if isinstance(query_response, list):
query_response = jsonify(query_response)
return make_response(query_response, status, headers)